Open Source & Case StudiesCOCKROACHDB · OPEN SOURCE PR #173411
SYSTEMS HARDENING

Transactional Range Split Isolation & Split Key Deferral

Defers non-transactional statistics-derived split-and-scatter side effects from pre-commit execution to post-commit background backfill jobs, preventing stale split keys from persisting across aborted schema-change transactions.

Role

  • Distributed SQL
  • KV Storage
  • Schema Changer
  • Raft Consensus
  • Go Systems Engineering

Category

Distributed SQL & KV Storage

Engineering discipline

SYSTEMS HARDENING

Public PR:PR #173411
Issue Isolated:#173241
Internal Tracker:CRDB-66557
CockroachDB Transactional Range Split Isolation PR #173411 engineered by Patrick Ribbsaeter

Patrick Ribbsaeter · Independent open-source contribution

Engineering objective

System challenge

A declarative schema-change transaction created statistics-derived range splits before commit. When the transaction aborted, splits survived in KV. Subsequent descriptor reuse of the same index ID under a new schema caused surviving split keys to split inside column families or rows.

Constraints

Working within real limits

  • Preserve declarative schema changer lifecycle across pre-commit and post-commit backfill stages
  • Defer statistics-derived split-and-scatter execution to runBackfill in exec_backfill.go
  • Remove pre-commit split emission in schemachanger opgen
  • Verify with unit test TestIndexSplitAndScatterAbortedTransactionNoSurvivingSplits verifying zero surviving splits on abort

Approach

How it was built

  1. 01

    Traced declarative schema changer lifecycle across pre-commit and post-commit backfill stages

  2. 02

    Deferred statistics-derived split-and-scatter execution to runBackfill in exec_backfill.go

  3. 03

    Removed pre-commit split emission in schemachanger opgen

  4. 04

    Added unit test TestIndexSplitAndScatterAbortedTransactionNoSurvivingSplits verifying zero surviving splits on abort

Technical validation

Implementation evidence

Observable engineering evidence. Discipline: SYSTEMS HARDENING

Public PR

PR #173411

Issue Isolated

#173241

Internal Tracker

CRDB-66557

Files Changed

4 files

Test Suite

100% Passed

Public evidence

Review the upstream contribution

Outcome

What was delivered

  • Decoupled non-transactional AdminSplitRequest side-effects from uncommitted transactions

  • Prevented stale split keys from persisting across transaction aborts

  • All CockroachDB static analysis, blathers release-justification, and CLA checks green

Technologies

Stack and tools

GoCockroachDBDistributed SQLKV StorageSchema ChangerRaft

Next engineering system

PRODUCT ENGINEERING · LOCAL SERVICES

GlasHelder Eindhoven: 60-Sec Booking Engine

Have an ambitious AI system to build?

Let’s build something serious.

I work across AI architecture, product engineering, private inference, automation, SaaS infrastructure, and production hardening.