mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-12-25 15:55:17 +00:00
Fix sync state machine issue for sharding case (#102)
* Fix sync state machine issue for sharding case * Fix fmt lint
This commit is contained in:
parent
2f3361fafc
commit
055d1fa32d
@ -561,7 +561,10 @@ impl SerialSyncController {
|
||||
while !completed {
|
||||
match self.state {
|
||||
SyncState::Idle => {
|
||||
if self.peers.count(&[Found, Connecting, Connected]) > 0 {
|
||||
if self
|
||||
.peers
|
||||
.all_shards_available(vec![Found, Connecting, Connected])
|
||||
{
|
||||
self.state = SyncState::FoundPeers;
|
||||
} else {
|
||||
self.try_find_peers();
|
||||
@ -569,7 +572,10 @@ impl SerialSyncController {
|
||||
}
|
||||
|
||||
SyncState::FindingPeers { since, .. } => {
|
||||
if self.peers.count(&[Found, Connecting, Connected]) > 0 {
|
||||
if self
|
||||
.peers
|
||||
.all_shards_available(vec![Found, Connecting, Connected])
|
||||
{
|
||||
self.state = SyncState::FoundPeers;
|
||||
} else {
|
||||
// storage node may not have the specific file when `FindFile`
|
||||
|
Loading…
Reference in New Issue
Block a user