From c57c23a9ff90e15693e47736410c6eeb003ced4c Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Tue, 22 Oct 2024 13:05:37 +0000 Subject: [PATCH] Feeders push checkpoints even if they are equivalent The feeder previously short circuited if the witness had already witnessed an equivalent checkpoint. This meant that logs would get stale timestamps from the witnesses. This change makes it so that the witness will keep updating their timestamps on checkpoints. --- internal/feeder/feeder.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/feeder/feeder.go b/internal/feeder/feeder.go index 63858e5..a06ae3b 100644 --- a/internal/feeder/feeder.go +++ b/internal/feeder/feeder.go @@ -150,7 +150,11 @@ func submitToWitness(ctx context.Context, cpRaw []byte, cpSubmit log.Checkpoint, } if latestCP.Size == cpSubmit.Size && bytes.Equal(latestCP.Hash, cpSubmit.Hash) { klog.V(1).Infof("%q unchanged - @%d: %x", logName, latestCP.Size, latestCP.Hash) - returnCp = latestCPRaw + if returnCp, err = opts.Witness.Update(ctx, opts.LogID, cpRaw, [][]byte{}); err != nil { + e := fmt.Errorf("failed to submit fresh checkpoint to witness: %v", err) + klog.Warning(e.Error()) + return e + } return nil } }