Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion manager/job/sync_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import (
resource "d7y.io/dragonfly/v2/scheduler/resource/standard"
)

// SyncPeers is an interface for sync peers.
// SyncPeers is an interface for sync peers. It is only supported in Rust client,
// refer to https://github.com/dragonflyoss/client.
type SyncPeers interface {
// CreateSyncPeers creates sync peers job, and merge the sync peer results with the data
// in the peer table in the database. It is a synchronous operation, and it will returns
Expand Down Expand Up @@ -195,6 +196,13 @@ func (s *syncPeers) mergePeers(ctx context.Context, scheduler models.Scheduler,
// Convert sync peer results from slice to map.
syncPeers := make(map[string]*resource.Host, len(results))
for _, result := range results {
// Skip the sync peer that does not belong to the scheduler cluster,
// it is only supported in Rust client. The golang client lacks the
// SchedulerClusterID field.
if result.SchedulerClusterID == 0 {
continue
}

syncPeers[result.ID] = result
}

Expand Down
Loading