feat(caddystorage): simplify CaddyStorage gRPC API to allow only one2one calls

This commit is contained in:
Pasha Sviderski committed 2026-09-08 14:36:43 +10:00
1 parent 842f796e38
commit 992b819f5b
6 files changed
+304 -563

No files matched your search

+20
View File
@@ -141,3 +141,23 @@ func (cli *Client) WaitClusterReady(ctx context.Context, timeout time.Duration)
}
return backoff.Retry(listMachines, boff)
}
// WaitForStoreVersion waits until the cluster store on the target machine has reached each requested actor version
// in minVersion, with no known missing or pending transactions through those versions.
// The context controls cancellation and the deadline. An empty minVersion requires no replication.
// This method observes replication without initiating synchronisation.
//
// Corrosion may satisfy a version by applying its surviving changes or by marking it complete because its changes
// have been superseded.
//
// Waiting normally makes the captured data available on the machine. However, another write may replace some of that
// data before it arrives. Corrosion can then complete the older version without transferring the replaced data.
// If the replacement is outside the requested versions, this method can succeed while the affected data is still
// missing or outdated. This can happen during concurrent updates even when all machines are well connected.
//
// Success does not guarantee an exact snapshot or delivery of every historical value.
// Callers that require a specific record or condition should verify it after waiting.
func (cli *Client) WaitForStoreVersion(ctx context.Context, minVersion map[string]uint64) error {
_, err := cli.MachineClient.WaitForStoreVersion(ctx, &pb.WaitForStoreVersionRequest{MinVersion: minVersion})
return err
}