GCP log wrt request preconditions

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
gcp, go
Domain
backend, cloud

Research direction

Start by reading PR #70 for the tile write case and PR #61 for the checkpoint write case, then compare their request-precondition handling with the behavior described here. Confirm whether any work remains beyond those implementations, including the need to retry a failed Integrate step in Cloud Build; the issue does not name files or tests.

Written by the indexing model from the issue text.

Description

The GCP log implementation uses request preconditions to address race conditions.

Case 1:

Tile write failure: implemented in https://github.com/transparency-dev/serverless-log/pull/70.

Entries have been sequenced successfully, but when Integrate runs, writing a tile (partial or full) somehow results in a tile that is different that the one that has already been written. This should not happen.

Case 2:

Checkpoint write failure: implemented in https://github.com/transparency-dev/serverless-log/pull/61.

If there is a race condition in Integrate, one run will fail because the checkpoint will have changed by the time it wants to write its version of the checkpoint. This may happen in race conditions. Since Integrate is idempotent, you just need to invoke the Cloud Function again.

If you are invoking the functions from Cloud Build (as we are in the Armored Witness project), the log operator will need to manually retry the Integrate step of the Cloud Build config that failed OR the log will not be updated until the next time an entry gets added and Sequence and Integrate are invoked. It is okay for the latter to happen wrt integrity of the log; the only consequence is that the log will not include the failed run's entry until the next Integrate call.

Dominant language
Go
Stars
9
Forks
7
Avg merge
7h 23m
Merged PRs (30d)
9

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.

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.