Skip to content

box.sequence: sequence_data recovery after reset#10940

Merged
locker merged 1 commit intotarantool:masterfrom
LevKats:gh-9871-sequence-state-reset-wal
Jan 30, 2025
Merged

box.sequence: sequence_data recovery after reset#10940
locker merged 1 commit intotarantool:masterfrom
LevKats:gh-9871-sequence-state-reset-wal

Conversation

@LevKats
Copy link
Contributor

@LevKats LevKats commented Dec 13, 2024

There are two sources of sequence state in tarantool: _sequence_data table and it's light version used in box/sequence.c which is stored in a hashmap. The reason for this decision was lack of cross-engine transactions. The first is used in lua API, the second -- internally to process memtx index updates. Now lua reset() call always produce WAL entry and we don't rely on memtx tables content during the initial recovery since the latest hasmap state is stored into snapshot directly.

Fixes #9871
NO_DOC=bugfix

@LevKats LevKats requested a review from Serpentian December 13, 2024 12:29
@LevKats LevKats self-assigned this Dec 13, 2024
@LevKats LevKats requested a review from a team as a code owner December 13, 2024 12:29
@LevKats LevKats force-pushed the gh-9871-sequence-state-reset-wal branch 2 times, most recently from f2a67bd to 5a1e7a5 Compare December 13, 2024 12:39
@coveralls
Copy link

coveralls commented Dec 13, 2024

Coverage Status

coverage: 87.372% (+0.005%) from 87.367%
when pulling 01711be on LevKats:gh-9871-sequence-state-reset-wal
into b99ae44
on tarantool:master
.

@LevKats LevKats requested a review from locker December 13, 2024 13:11
@Serpentian Serpentian removed their assignment Dec 18, 2024
@LevKats LevKats force-pushed the gh-9871-sequence-state-reset-wal branch 2 times, most recently from 5f190b5 to 529f167 Compare January 22, 2025 14:57
@LevKats LevKats requested a review from Serpentian January 22, 2025 15:21
Copy link
Contributor

@Serpentian Serpentian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nits are left from my side. I'm ok with the current patch, since it won't be easy to allow on_replace, when there's no old_tuple and there's no much sense in it.

@Serpentian Serpentian removed their assignment Jan 26, 2025
@LevKats LevKats force-pushed the gh-9871-sequence-state-reset-wal branch 2 times, most recently from 555c7ef to 0ba7f33 Compare January 28, 2025 04:49
@LevKats LevKats requested a review from Serpentian January 28, 2025 05:09
There are two sources of sequence state in tarantool: `_sequence_data`
table and its light version used in `box/sequence.c` which is stored
in a hashmap. The reason for this decision was lack of cross-engine
transactions. The first is used in lua API, the second -- internally
to process memtx index updates. Now lua `reset()` call is always replayed
during the final recovery on one hand and we don't rely on the spaces
(other than system ones) content during the initial recovery since the
latest hasmap state is stored into the snapshot directly on the other
hand.

Fixes tarantool#9871
NO_DOC=bugfix
@LevKats LevKats force-pushed the gh-9871-sequence-state-reset-wal branch from 0ba7f33 to 01711be Compare January 29, 2025 09:11
@Serpentian Serpentian assigned locker and unassigned LevKats and Serpentian Jan 29, 2025
@locker locker added the full-ci Enables all tests for a pull request label Jan 29, 2025
@locker locker merged commit 88fc5c1 into tarantool:master Jan 30, 2025
95 checks passed
@locker
Copy link
Member

locker commented Jan 30, 2025

Cherry-picked to 3.3, 3.2, 2.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sequence state is not saved after reset and tarantool restart.

5 participants