Skip to content
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
wants to merge 30 commits into
base: devel
Choose a base branch
from

Conversation

goedderz
Copy link
Member

@goedderz goedderz commented Mar 11, 2024

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.

  • 🍕 New feature

Checklist

  • Tests
    • Regression tests
    • C++ Unit tests
    • integration tests
    • resilience tests

Related Information

…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
@goedderz goedderz added this to the devel milestone Mar 11, 2024
@goedderz goedderz self-assigned this Mar 11, 2024
@cla-bot cla-bot bot added the cla-signed label Mar 11, 2024
@goedderz goedderz marked this pull request as ready for review March 12, 2024 19:43
@goedderz goedderz requested review from a team as code owners March 12, 2024 19:43
@goedderz goedderz requested a review from mchacki March 12, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant