MVStore.registerVersionUsage() in "non-transactional" DDL flow#2986
Closed
andreitokar wants to merge 1 commit intoh2database:masterfrom
Closed
MVStore.registerVersionUsage() in "non-transactional" DDL flow#2986andreitokar wants to merge 1 commit intoh2database:masterfrom
andreitokar wants to merge 1 commit intoh2database:masterfrom
Conversation
…nsactional" DDL flow
Contributor
|
I can't run slow tests right now, but I'm not sure about other DDL commands not touched here. Maybe they also need similar changes. |
Contributor
Author
|
@katzyn, which "other DDL commands" you are referring to? I haven't introduce those commit calls in the middle of DDL flow, just amended existing ones. I think, that I covered all such cases. Whether those commits are needed for some other DDL commands is still an open question. |
Contributor
Author
|
close in favor of #2987 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This should fix #2590
Issue MVStore.registerVersionUsage() right after commit() in "non-transactional" DDL flow.
The problem is that the index re-build (and few others "non-transactional" commands) is running "outside" of normal statement execution path, because those commands do commit() (and therefore MVStore.deregisterVersionUsage()) before they start, but after SessionLocal.startStatementWithinTransaction(). Subsequent updates appear like they do not belong to the statement, and they are not protected with MVStore.registerVersionUsage()/deregisterVersionUsage() pair, which makes them vulnerable.