-
Notifications
You must be signed in to change notification settings - Fork 610
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
Volatile transaction support in EvWrite #2196
Volatile transaction support in EvWrite #2196
Conversation
⚪
|
⚪
|
TValidatedWriteTx::TValidatedWriteTx(TDataShard* self, TTransactionContext& txc, ui64 globalTxId, TInstant receivedAt, const TRowVersion& readVersion, const TRowVersion& writeVersion, const NEvents::TDataEvents::TEvWrite& ev) | ||
: UserDb(*self, txc.DB, globalTxId, readVersion, writeVersion, EngineHostCounters, TAppData::TimeProvider->Now()) | ||
TValidatedWriteTx::TValidatedWriteTx(TDataShard* self, TTransactionContext& txc, ui64 globalTxId, TInstant receivedAt, const NEvents::TDataEvents::TEvWrite& ev) | ||
: UserDb(*self, txc.DB, globalTxId, TRowVersion::Min(), TRowVersion::Max(), EngineHostCounters, TAppData::TimeProvider->Now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему readVersion=Min, writeVersion=Max? Это даже никакого смысла не имеет, если с такими настройками произойдёт запись в базу, то потом все инварианты поедут. Кроме того в случае mvcc различающиеся версии read и write это не нормально.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сошлись на том, что UserDb нужно хранить во WriteOperation.
И read/write version нужно брать свежие, прямо перед записью.
И нужно осторожнее с WriteVersion, чтобы он не пришёл со значением Max в локальную базу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Только не во WriteOperation, а на стеке в том юните, который собирается работать с базой.
⚪
|
⚪
|
Changelog entry
Volatile transaction support in EvWrite
Changelog category
Additional information
...