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

add do_not_shard_destination option #866

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions collector/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type Configuration struct {
CheckpointStorage string `config:"checkpoint.storage"`
CheckpointInterval int64 `config:"checkpoint.interval"`
FullSyncExecutorDebug bool `config:"full_sync.executor.debug"`
FullSyncDoNotShardDest bool `config:"full_sync.do_not_shard_destination"`
IncrSyncDBRef bool `config:"incr_sync.dbref"`
IncrSyncExecutor int `config:"incr_sync.executor"`
IncrSyncExecutorDebug bool `config:"incr_sync.executor.debug"` // !ReplayerDurable
Expand Down
5 changes: 5 additions & 0 deletions collector/docsyncer/doc_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ func IsShardingToSharding(fromIsSharding bool, toConn *utils.MongoCommunityConn)
return false
}

if conf.Options.FullSyncDoNotShardDest {
LOG.Info("full_sync.do_not_shard_destination set, no need to check IsShardingToSharding")
return false
}

var source, target string
if fromIsSharding {
source = "sharding"
Expand Down
3 changes: 3 additions & 0 deletions conf/collector.conf
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ full_sync.collection_exist_drop = true
# background表示创建后台索引。
full_sync.create_index = none

# do not make destination collection sharding if source collection is sharding
full_sync.do_not_shard_destination = false

# convert insert to update when duplicate key found
# 如果_id存在在目的库,是否将insert语句修改为update语句。
full_sync.executor.insert_on_dup_update = false
Expand Down