transparency-dev / transparency-dev/distributor

Feature: support merging checkpoints that were received out of sync

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
5
Forks
7
Avg merge
1d 18h
Merged PRs (30d)
6

Description

This is easiest to explain with an example timeline with two witnesses, A & B:

  1. A sends checkpoint of size X
  2. B sends checkpoint of size X
  3. A sends checkpoint of size X+1
  4. A sends checkpoint of size X+2
  5. B sends checkpoint of size X+1

Asking for checkpoint with N=2 will give a checkpoint of size X, where a checkpoint of size X+1 should be possible.

The reason for this is that the distributor is optimized to only keep the latest checkpoint seen for each witness+log pair in the pool of checkpoints available for merging. If this is replaced before it is merged and promoted then it is lost forever.

There are a number of ways to go about fixing this, but they all risk making the size of the database unbounded in size, or increasing complexity. The current strategy is to wait to see if this appears to be a problem before taking on that risk/complexity.

This test case is covered in cmd/internal/distributor/distributor_test.go: TODO: N=2 can get historic version where both have been seen but not at same time

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cmd/internal/distributor/distributor_test.go and the TODO describing the out-of-sync checkpoint timeline. Trace the distributor's checkpoint pool behavior and evaluate the possible retention approaches mentioned in the issue. Done means an N=2 request can return the historic X+1 checkpoint after both witnesses have sent it, without introducing unacceptable unbounded database growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.