Skip to content

Mirror client fixes - #1086

Open
AlCutter wants to merge 1 commit into
transparency-dev:mainfrom
AlCutter:mirror_client_fixes
Open

Mirror client fixes#1086
AlCutter wants to merge 1 commit into
transparency-dev:mainfrom
AlCutter:mirror_client_fixes

Conversation

@AlCutter

Copy link
Copy Markdown
Collaborator

This PR makes a couple of minor fixes to the MTC mirror client:

  1. Allow zero-sized checkpoints to collect cosignatures / refresh checkpoints on quiescent logs.
  2. Don't panic if a "short" entry bundle is returned from the source log.

Towards #945

Comment thread client/mirror/client.go

// Push the checkpoint with the old size (0 if not provided).
for c.oldSize < targetSize {
// Keep trying for as long we we get conflict errors or the context is not cancelled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Keep trying for as long we we get conflict errors or the context is not cancelled.
// Keep trying for as long as we get conflict errors or the context is not cancelled.

Comment thread client/mirror/client.go
// Ensure we send the checkpoint at least once, this serves two purposes:
// 1. We refresh the witness' timestamped view of the log, committing to the fact that the log hasn't grown.
// 2. If this is the first time we're pushing the checkpoint (i.e. c.oldSize == 0), we're ensuring that we'll send a zero-sized checkpoint.
for {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an infinite loop in the following scenario:

  • If the mirror's pending size is greater than targetSize (e.g., conflict.PendingSize=10 while targetSize=5), c.oldSize becomes 10.
  • In the next loop iteration, pushCheckpoint is called with c.oldSize=10 and targetSize=5.
  • The mirror rejects requests where uploadStart > uploadEnd and returns another ErrConflict error.
  • This Sync function continuously retries the failing request in an infinite loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants