mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
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:
commit
f5e656138f
1 changed files with 7 additions and 0 deletions
7
view.go
7
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue