avoid serializing for sync shards in 1 node cluster situation

This commit is contained in:
Jason E. Aten 2020-12-10 20:43:21 +00:00
parent 8c20255b12
commit 7571792401

View file

@ -336,6 +336,13 @@ func (v *view) CreateFragmentIfNotExists(shard uint64) (*fragment, error) {
func (v *view) notifyIfNewShard(shard uint64) {
// if single node, don't bother serializing only to drop it b/c
// we won't send to ourselves.
srv, ok := v.broadcaster.(*Server)
if ok && len(srv.cluster.Nodes()) == 1 {
return
}
if v.knownShards.Contains(shard) { //checks the fields remoteShards bitmap to see if broadcast needed
return
}