cockroachdb / cockroachdb/cockroach

engineccl: pipeline registry rotation

Open
#119,092 0 comments 0 reactions 0 assignees View on GitHub
A-storage C-enhancement O-support P-3 T-storage
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Today, when encryption-at-rest decides it needs to rotate the encryption-at-rest registry, it blocks all incoming mutations during the rotation. With a large store, building and writing out the the new registry file can take non-negligible time. If ill-timed, this can block WAL rotation, blocking all user writes (and reads of new files too due to #98051).

When we decide we need to rotate the registry, we could asynchronously begin writing the snapshotted state to the new file. New mutations after the snapshot is taken are buffered. Once complete, we flush the queued mutations to the new file and atomically switch over. The mutex is only blocked during the moment of the switchover.

Jira issue: CRDB-36033

Contributor guide

Open the contributing guide

Research direction

Start by locating the engineccl encryption-at-rest registry rotation implementation and tracing how mutations and WAL rotation interact with it. Done means registry snapshots can be written asynchronously, post-snapshot mutations are buffered and flushed, and the mutex is held only for the atomic switchover without blocking normal reads and writes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.