8000 Fix arangorestore API to create _rev on shard leader [BTS-1232]. by neunhoef · Pull Request #18191 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Fix arangorestore API to create _rev on shard leader [BTS-1232]. #18191

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

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

neunhoef
Copy link
Member

Scope & Purpose

This is about https://arangodb.atlassian.net/browse/BTS-1232 .

Short description:

arangorestore uses the (undocumented) API /_api/replication/restore-data
implemented in the RestReplicationHandler. Since ArangoDB 3.8, we
create new _rev values during the restore operation. Unfortunately,
this creation of _rev values was done on the coordinator(s) and since
these are hybrid logical clock (HLC) values, it can happen that the
generated _rev values on two different coordinators are the same for
two different documents. This will clash on the leader of the OneShard
database, since there, the newly generated _rev values are used as
internal document IDs, which directly translate into a RocksDB key in
the DocumentsColumnFamily. This leads to a collision and this manifests
itself as a lock timeout, since two different RocksDB transactions try
to touch the same key. However, even if no lock timeout would have
happened, the consequences would have been dire: Namely, there would
have been a corruption between primary index and data in the Documents
column family. We would have had two primary index entries pointing to
the same document.

  • [*] 💩 Bugfix

Checklist

  • [*] 📖 CHANGELOG entry made
  • [*] Backports
    • [*] Backport for 3.8: This is it.

Related Information

@neunhoef neunhoef added this to the 3.8 milestone Feb 24, 2023
@neunhoef neunhoef self-assigned this Feb 24, 2023
@cla-bot cla-bot bot added the cla-signed label Feb 24, 2023
Copy link
Contributor
@jsteemann jsteemann left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member
@mchacki mchacki left a comment

Choose a reason for hiding this comment

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

LGTM

@KVS85 KVS85 merged commit b5a5a51 into 3.8 Mar 2, 2023
@KVS85 KVS85 deleted the bug-fix-3.8/arangorestore-duplicate-revs branch March 2, 2023 10:57
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.

4 participants
0