From 75717924013899435f4987a93d216e47317f1cb3 Mon Sep 17 00:00:00 2001 From: "Jason E. Aten" Date: Thu, 10 Dec 2020 20:43:21 +0000 Subject: [PATCH] avoid serializing for sync shards in 1 node cluster situation --- view.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/view.go b/view.go index 91e144cc4..912d85743 100644 --- a/view.go +++ b/view.go @@ -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 }