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:
Maarten Rijke
2026-06-27 23:56:37 +03:00
committed by Tangled
parent c0e20d7baf
commit 2e55352974
+11 -5
View File
@@ -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.