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

Lock zero copy parts more atomically #49211

Merged
merged 17 commits into from May 3, 2023
Merged

Conversation

alesapin
Copy link
Member

@alesapin alesapin commented Apr 26, 2023

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix possible dataloss because of non-atomic locking in zero copy replication. Fixes #48474 (comment).

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-bugfix Pull request with bugfix, not backported by default label Apr 26, 2023
@robot-ch-test-poll1
Copy link
Contributor

robot-ch-test-poll1 commented Apr 30, 2023

This is an automated comment for commit 6f3f202 with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🟡 pending

Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR🟡 pending
Mergeable CheckChecks if all other necessary checks are successful🟢 success

@alesapin
Copy link
Member Author

alesapin commented May 1, 2023

You can ask -- what does it mean "more atomically"? Because we still have places where we do it non-atomically, but all merges/mutations/fetches create zero-copy locks atomically with parts commit now.

@SmitaRKulkarni SmitaRKulkarni self-assigned this May 1, 2023
@@ -861,6 +868,12 @@ class StorageReplicatedMergeTree final : public MergeTreeData
int32_t mode = zkutil::CreateMode::Persistent, bool replace_existing_lock = false,
const String & path_to_set_hardlinked_files = "", const NameSet & hardlinked_files = {});

static void getZeroCopyLockNodeCreaetOps(
Copy link
Member

Choose a reason for hiding this comment

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

typo

Suggested change
static void getZeroCopyLockNodeCreaetOps(
static void getZeroCopyLockNodeCreateOps(

Copy link
Member

@SmitaRKulkarni SmitaRKulkarni left a comment

Choose a reason for hiding this comment

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

Rest all LGTM

@alesapin
Copy link
Member Author

alesapin commented May 3, 2023

Bad cast: #49445

@alesapin
Copy link
Member Author

alesapin commented May 3, 2023

logger issues #49420

@alesapin
Copy link
Member Author

alesapin commented May 3, 2023

Keeper multinode #49446

@alesapin
Copy link
Member Author

alesapin commented May 3, 2023

Really hard to validate this bugfix

@alesapin alesapin merged commit 5504475 into master May 3, 2023
9 of 140 checks passed
@alesapin alesapin deleted the fix_zero_copy_not_atomic branch May 3, 2023 11:12
auto error = zookeeper->tryMulti(ops, responses);
if (error == Coordination::Error::ZOK)
size_t failed_op = zkutil::getFailedOpIndex(error, responses);
/// Part was locked before, unfortunately it's possible during moves
Copy link
Member

Choose a reason for hiding this comment

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

@alesapin, did you mean replace/move partition or moves between disks? AFAIU, during replace/move partition, the existing lock is ephemeral...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The specified key does not exist
5 participants