Am 24.09.2020 um 17:56 schrieb fengiaw:
Hi devs,I am working on JackRabbit Oak jcr, and have questions about the node deletion. Our backend store is using mysql. When I check the data in mysql, I can see two fields related to deletion, one is "_deleted" and the other one is "deletedOnce". From the documentation, "deletedOnce" only indicates if the doc is deleted once, what the prupose of this field? From these two fields, how could I determine whether a node is indeed deleted (Not using apis, e.g. session.nodeExists) ? I was relying on the "_deleted" field, and tried to use the latest value of it to determine whether it's gotten deleted. For example, _deleted={r173bcb4360b-0-34d=false, r173bcb2fb8f-0-34d=false, r173bcaf6d2c-0-34e=false, r173bcae10fa-0-350=false, r173bcac5862-0-34d=false, r173bcac5859-0-34d=false, r173bc9bf9f0-0-342=false, r173bc9a42ce-0-343=false, r173bc994dce-0-34d=false, r173bc962853-0-34d=false, r173bc942ceb-0-34d=false, r173baa5a789-0-329=true, r1739196c343-1-2e9=false}. The latest value is "r173bcb4360b-0-34d=false", base on this, I assume it's not deleted. But actually, I have deleted this node via our UI, and it disappears in explorer as well. So the question here is from the mysql record, what is the best/correct way to determin a node indeed exists or gets deleted?
That's an implementation detail - you are not supposed to look at the DB. That said, the details are contained in the source of DocumentStore RevisionGC; essentially these are only flags that are used to find the nodes that might qualify for permanent deletion (but might still be needed, for instance, because they are referenced by a checkpointed state). Best regards, Julian
