Skip to content

Commit

Permalink
Feeders push checkpoints even if they are equivalent
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mhutchinson committed Oct 22, 2024
1 parent 36d0b0e commit c57c23a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/feeder/feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit c57c23a

Please sign in to comment.