Merge pull request #1211 from jaten-molecula/skip_serz_1node

avoid serializing for sync shards in 1 node cluster situation
This commit is contained in:
tgruben 2020-12-10 17:16:10 -06:00 committed by GitHub
commit f5e656138f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}