mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 04:06:58 +00:00
hold/pds: fix scan broadcaster predecessor check to compare successor did
checkPredecessor returned true for any hold with a non-empty successor field, without verifying the successor was actually this hold. This caused every hold running proactive scan discovery to queue manifests from every other migrated hold on the network, producing 404 errors when the scanner tried to fetch foreign blobs from its own S3. Signed-off-by: Maarten Rijke <did:plc:fy4lwkc4hrd776vfkcrbzr5a>
This commit is contained in:
@@ -1446,13 +1446,19 @@ func (sb *ScanBroadcaster) checkPredecessor(ctx context.Context, holdDID string)
|
||||
return false
|
||||
}
|
||||
|
||||
if captain.Successor != "" {
|
||||
slog.Info("Proactive scan: discovered migrated hold (has successor label)",
|
||||
"holdDID", holdDID, "successor", captain.Successor)
|
||||
return true
|
||||
if captain.Successor == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
return false
|
||||
if captain.Successor != sb.holdDID {
|
||||
slog.Debug("Proactive scan: hold has successor, but it is not us",
|
||||
"holdDID", holdDID, "successor", captain.Successor, "ourHoldDID", sb.holdDID)
|
||||
return false
|
||||
}
|
||||
|
||||
slog.Info("Proactive scan: discovered migrated hold pointing at us as successor",
|
||||
"holdDID", holdDID, "successor", captain.Successor)
|
||||
return true
|
||||
}
|
||||
|
||||
// hasConnectedScanners returns true if at least one scanner is connected.
|
||||
|
||||
Reference in New Issue
Block a user