From 2b146b103ad50e7d6d84521189ed27e87b518836 Mon Sep 17 00:00:00 2001 From: Bogdan Rosianu Date: Wed, 25 Oct 2023 14:15:55 +0300 Subject: [PATCH] fix nodes cleanup after reloading --- cmd/proxy/config/config.toml | 14 +++----------- observer/baseNodeProvider.go | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cmd/proxy/config/config.toml b/cmd/proxy/config/config.toml index d61623a5..13ea7789 100644 --- a/cmd/proxy/config/config.toml +++ b/cmd/proxy/config/config.toml @@ -74,14 +74,6 @@ Address = "http://127.0.0.1:8082" [[Observers]] - ShardId = 1 - Address = "http://127.0.0.1:8083" - IsFallback = true - -[[FullHistoryNodes]] - ShardId = 0 - Address = "http://127.0.0.1:8081" - -[[FullHistoryNodes]] - ShardId = 1 - Address = "http://127.0.0.1:8082" + ShardId = 4294967295 + Address = "http://127.0.0.1:8083 + IsFallback = false diff --git a/observer/baseNodeProvider.go b/observer/baseNodeProvider.go index 07f475df..e5c0724c 100644 --- a/observer/baseNodeProvider.go +++ b/observer/baseNodeProvider.go @@ -405,6 +405,7 @@ func (bnp *baseNodeProvider) ReloadNodes(nodesType data.NodeType) data.NodesRelo bnp.mutNodes.Lock() bnp.shardIds = getSortedShardIDsSlice(newNodes) bnp.syncedNodes, bnp.syncedFallbackNodes = initAllNodesSlice(newNodes) + bnp.outOfSyncNodes, bnp.outOfSyncFallbackNodes = make([]*data.NodeData, 0), make([]*data.NodeData, 0) bnp.lastSyncedNodes = make(map[uint32]*data.NodeData) bnp.mutNodes.Unlock()