Skip to content

MVStore.registerVersionUsage() in "non-transactional" DDL flow#2986

Closed
andreitokar wants to merge 1 commit intoh2database:masterfrom
andreitokar:non-transactional
Closed

MVStore.registerVersionUsage() in "non-transactional" DDL flow#2986
andreitokar wants to merge 1 commit intoh2database:masterfrom
andreitokar:non-transactional

Conversation

@andreitokar
Copy link
Contributor

@andreitokar andreitokar commented Dec 30, 2020

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.

@katzyn
Copy link
Contributor

katzyn commented Dec 30, 2020

I can't run slow tests right now, but commit() in the middle of some DDL command definitely moves its transaction into unsafe state.

I'm not sure about other DDL commands not touched here. Maybe they also need similar changes.

@andreitokar
Copy link
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.
Ideally, decision about whether to commit all previous work has to be done and acted upon earlier, at Command.executeUpdate() level, before session.startStatementWithinTransaction(this) call.

@andreitokar
Copy link
Contributor Author

close in favor of #2987

@andreitokar andreitokar closed this Jan 1, 2021
@andreitokar andreitokar deleted the non-transactional branch January 2, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java.lang.IllegalStateException: Chunk XXX not found [1.4.200/9] on index creation

2 participants