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
[CINFRA-882] Part 1/2: Add lowest safe index for unique index creation #20718
Open
goedderz
wants to merge
30
commits into
devel
Choose a base branch
from
feature/cinfra-882-add-lowest-safe-index-for-unique-index-creation
base: devel
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CINFRA-882] Part 1/2: Add lowest safe index for unique index creation #20718
goedderz
wants to merge
30
commits into
devel
from
feature/cinfra-882-add-lowest-safe-index-for-unique-index-creation
Conversation
This file contains 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
…afe indexes on the leader state machine
…fra-882-add-lowest-safe-index-for-unique-index-creation
…fra-882-add-lowest-safe-index-for-unique-index-creation
…fra-882-add-lowest-safe-index-for-unique-index-creation
…fra-882-add-lowest-safe-index-for-unique-index-creation
…fra-882-add-lowest-safe-index-for-unique-index-creation
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.
Scope & Purpose
Allow for safe (unique) index creation with Replication 2.0. (Unfinished, see note below!)
Add a metadatum lowest safe index for replay (LSIFR) to each document state machine. It contains, per shard, a lowest log index that is safe for replay: i.e., lower indexes might not be safe to replay. This is due to unique indexes: After a unique index has been created, log entries before the CreateIndex entry must not be replayed, because they could lead to divergent states.
This PR introduces the metadatum, persists it during index creation (on both leader and follower), and honors it during log replay (both recovery on the leader, and apply entries on the follower).
The implemented approach is described in https://arangodb.atlassian.net/wiki/spaces/CInfra/pages/2220326994/Simplified+implementation, part of a more thorough discussion in https://arangodb.atlassian.net/wiki/spaces/CInfra/pages/2207154243/Index+creation+in+the+document+state+machine.
Important note: What this PR does not yet implement is transferring the metadata during a snapshot transfer, which is actually crucial for this to work! I open this up now only not to make this PR larger than it already is, a second PR will follow later.
Checklist
Related Information