OADA / oada-cache

2 stars 0 forks source link

cache should do some more checking for resource breaks on tree PUT #15

Open sanoel opened 4 years ago

sanoel commented 4 years ago

E.g., I'm writing an import script. I delete the tree while I am fixing things, and following up with a rerun of my import (i.e., tree PUT) creates the structure on the server without any resource breaks because the cache thinks all of those resources already exist. I think this may also be a good first use case for thinking through how to fix mismatched trees.

tomohiroarakawa commented 4 years ago

I had the same issue before. I believe addressing #5 will fix this issue as well because _ensureTree() internally calls get() to check if the tree exists

aultac commented 4 years ago

In theory, ignoring the race condition case where it’s all happening very quickly, the cache has a watch set on the nodes of the tree that it thinks are already there, and the delete would flow in to the cache causing it to invalidate that resource locally. Then the next treePut would NOT think that those exist locally.

However, if it has set a watch down the tree somewhere, and somebody deletes or moves the link higher up, then it’s cached copy is never notified that the resources it has are no longer located at the place it thought they were. To achieve that, it’s almost like a parent link delete/overwrite needs to travel downward to child nodes and notify them via their web socket that they no longer live where they thought they did.

Aaron

On Feb 13, 2020, at 4:33 PM, Tomohiro Arakawa notifications@github.com wrote:

I had the same issue before. I believe addressing #5 https://github.com/OADA/oada-cache/issues/5 will fix this issue as well because _ensureTree() internally calls get() to check if the tree exists

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OADA/oada-cache/issues/15?email_source=notifications&email_token=AA2KEUGVGQVCS2FA2ZU47SDRCW4BFA5CNFSM4KUVW3DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELWWA2A#issuecomment-585982056, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2KEUDZDIOU66BAV3675L3RCW4BFANCNFSM4KUVW3DA.