Skip to content

Commit d5392e3

Browse files
committed
1 parent 6c342d8 commit d5392e3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

batch.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ func (d DeferredBatchOp) Finish() error {
151151
//
152152
// # Internal representation
153153
//
154+
// WARNING: Do not remove the ability to handle older internal
155+
// representations, without thinking through the consequences in CockroachDB.
156+
// Specifically, CockroachDB can have unapplied raft log entries that contain
157+
// encoded Pebble batches, and without a CockroachDB-level below-Raft
158+
// migration they can correspond to arbitrarily old binary versions. Pebble
159+
// needs to be able to successfully apply such batches.
160+
//
154161
// The internal batch representation is a contiguous byte buffer with a fixed
155162
// 12-byte header, followed by a series of records.
156163
//

format_major_version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ func (v FormatMajorVersion) MaxTableFormat() sstable.TableFormat {
308308

309309
// MinTableFormat returns the minimum sstable.TableFormat that can be used at
310310
// this FormatMajorVersion.
311+
//
312+
// WARNING: Do not bump this to a higher value without thinking through the
313+
// consequences in CockroachDB. Specifically, CockroachDB can have unapplied
314+
// raft log entries that correspond to sstable ingestions, and without a
315+
// CockroachDB-level below-Raft migration they can correspond to arbitrarily
316+
// old binary versions. Pebble needs to be able to successfully ingest such
317+
// sstables.
311318
func (v FormatMajorVersion) MinTableFormat() sstable.TableFormat {
312319
_ = v.resolveDefault()
313320
return sstable.TableFormatPebblev1

0 commit comments

Comments
 (0)