Repository navigation
Don't save shard config in LocalShard::create_snapshot - #4997
Merged
Merged
Conversation
xzfc
force-pushed
the
dont-save-shard-config
branch
from
September 2, 2024 00:22
b30dfa2 to
e89f7c6
Compare
generall
approved these changes
Sep 2, 2024
This file contains hidden or 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
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.
This PR removes code to save shard config in
LocalShard::create_snapshot.Reason: this file is getting overwritten in the only code path in which this method is called. So, no need to write it in the first place. Here is the call graph:
graph TD Collection::create_snapshot --> ShardReplicaSet::create_snapshot ForwardProxyShard::create_snapshot --> LocalShard::create_snapshot ProxyShard::create_snapshot --> LocalShard::create_snapshot QueueProxyShard::create_snapshot --> LocalShard::create_snapshot ShardReplicaSet::create_snapshot --> Shard::create_snapshot Shard::create_snapshot --> LocalShard::create_snapshot Shard::create_snapshot --> ProxyShard::create_snapshot Shard::create_snapshot --> ForwardProxyShard::create_snapshot Shard::create_snapshot --> QueueProxyShard::create_snapshot Shard::create_snapshot --> DummyShard::create_snapshot ShardHolder::creste_shard_snapshot --> ShardReplicaSet::create_snapshot _do_create_full_snapshot --> TableOfContent::create_snapshot TableOfContent::create_snapshot --> Collection::create_snapshot do_create_snapshot --> TableOfContent::create_snapshot class ShardReplicaSet::create_snapshot highlight1 class LocalShard::create_snapshot highlight2 classDef highlight1 color:#77FF77,fill:#222222 classDef highlight2 color:#FF7777,fill:#222222LocalShard::create_snapshot: removed code (this PR).ShardReplicaSet::create_snapshot: overwrites this file with{"type":"ReplicaSet"}.I've stumbled into this when updating the code to build a snapshot archive without copying files to a temporary directory. Adding two files with the same name to an archive is problematic.