-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition can cause notebook entry tag updates to be lost #5558
Comments
Replicated:
Going to look into merging entries upon conflict now. |
I think I've got the basic conflict resolution worked out, but running into some issues where if the annotation has never been created before (i.e., no tags have ever been made on an entry), and two users try to tag entry at the same time. In this case, knowing which annotation object to use is tricky. |
@akhenry Some ideas to fix:
|
I initially envisioned each tag being its own annotation (although not in anticipation of this problem - at least not consciously), so option 3 would align with that. It also completely skirts around the problem of notebook conflicts, which is nice. It's not a panacea though, it introduces the possibility of duplicate tags if two people add the same tag at exactly the same time. That said, it's a pretty benign edge case, one of the dupes can just be deleted. Of course, both users may spot the duplicate at the same time and decide to delete their annotation at the same time and get stuck in an infinite loop...In any case, the less often users are trying to modify the same object, the fewer opportunities for conflicts. How much work do you think it would be to make each tag a separate annotation? |
Also, are there performance implications for making each tag an annotation? Is it going to just completely destroy our performance? |
@akhenry I don't think it'll kill performance, but we'll certainly have more annotations. I prefer having one annotation per tag too, though this will be a bit of a backend overhaul. Do we want this to be backward compatible? If so, I'd suggest:
If not, we can:
|
After discussing with @akhenry, we think we don't need to be backwards compatible, and thus we'll do:
|
Saving this here for my memory:
|
@akhenry I'd also like to make sure this works with plots, and in that case, the user will be drawing a marquee across the plot to select points, and then tagging the point selection. In that case, I think we'll want the plot annotation (which is a target and a polygon) to have multiple tags, which means (I think) we won't be able to reuse the tagging components developed here, right? Or at least not as easily. |
Closed by #5763 |
Wasn't able to test, FF won't connect (cert issue) and safari can't throttle (as far as I could find) |
Unable to determine. Testathon 10/4/22 Since FF doesn't play well with Testathon, and Safari inexplicably cannot handle network throttling, we had many people add and delete tags to one entry in one notebook. There were a couple 409 conflict errors that were raised on my end, but not sure if this means this is not fixed? |
@akhenry to test |
Fixed! There is an issue now that Notebook conflicts are being reported to the user, as all object conflicts are, but that's unrelated. |
Summary
There is a race condition that can occur when two users update the tags on the same notebook entry at the same time. The race condition will cause one of the user's tag update to be lost. eg. If one user deletes a tag, and another user adds a tag to the same entry at the same time, the first edit (to remove the tag) is retained, but the second edit (to add a tag) will result in a conflict and an error. An identical issue can occur when adding or removing notebook entries. In this case we have some code that detects the conflict and merges the entry lists. Something similar will need to be implemented for notebook entry tags.
Expected vs Current Behavior
The edits should be merged so that both user's changes are retained.
Steps to Reproduce
Environment
Impact Check List
Additional Information
The text was updated successfully, but these errors were encountered: