[WIP] Check for concurrent edits of showplans #1191
Draft
+50
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a simple mechanism to check if two people are editing a showplan at the same time, by storing the time it was last modified.
Will go together with a WebStudio change that will, when opened, get the last modified time from the server, and then send it back on every updateShowPlan call. The server will only accept the change if the time still matches (guarded by a
SELECT FOR UPDATE
), otherwise WebStudio will force the user to reload.This can be a bit annoying, but the alternative is showplan corruption. Perhaps we can make WebStudio periodically poll for new changes to make it less annoying.