@@ -96,6 +96,9 @@ const (
9696 // heuristics, but is not required to be accurate for correctness.
9797 InternalKeyKindDeleteSized InternalKeyKind = 23
9898
99+ InternalKeyKindSpanStart InternalKeyKind = 24
100+ InternalKeyKindSpanEnd InternalKeyKind = 25
101+
99102 // This maximum value isn't part of the file format. Future extensions may
100103 // increase this value.
101104 //
@@ -105,7 +108,12 @@ const (
105108 // which sorts 'less than or equal to' any other valid internalKeyKind, when
106109 // searching for any kind of internal key formed by a certain user key and
107110 // seqNum.
108- InternalKeyKindMax InternalKeyKind = 23
111+ InternalKeyKindMax InternalKeyKind = 25
112+
113+ // NB: This is less than InternalKeyKindSpanStart and InternalKeyKindSpanEnd
114+ // because those key kinds are never used in durable formats; only as
115+ // special in-memory indicators.
116+ InternalKeyKindDurableMax InternalKeyKind = 23
109117
110118 // Internal to the sstable format. Not exposed by any sstable iterator.
111119 // Declared here to prevent definition of valid key kinds that set this bit.
@@ -157,6 +165,8 @@ var internalKeyKindNames = []string{
157165 InternalKeyKindRangeKeyDelete : "RANGEKEYDEL" ,
158166 InternalKeyKindIngestSST : "INGESTSST" ,
159167 InternalKeyKindDeleteSized : "DELSIZED" ,
168+ InternalKeyKindSpanStart : "SPANSTART" ,
169+ InternalKeyKindSpanEnd : "SPANEND" ,
160170 InternalKeyKindInvalid : "INVALID" ,
161171}
162172
@@ -249,6 +259,8 @@ var kindsMap = map[string]InternalKeyKind{
249259 "RANGEKEYDEL" : InternalKeyKindRangeKeyDelete ,
250260 "INGESTSST" : InternalKeyKindIngestSST ,
251261 "DELSIZED" : InternalKeyKindDeleteSized ,
262+ "SPANSTART" : InternalKeyKindSpanStart ,
263+ "SPANEND" : InternalKeyKindSpanEnd ,
252264}
253265
254266// ParseInternalKey parses the string representation of an internal key. The
@@ -476,7 +488,8 @@ func (k InternalKey) IsExclusiveSentinel() bool {
476488 }
477489 switch kind := k .Kind (); kind {
478490 case InternalKeyKindRangeDelete , InternalKeyKindRangeKeyDelete ,
479- InternalKeyKindRangeKeyUnset , InternalKeyKindRangeKeySet :
491+ InternalKeyKindRangeKeyUnset , InternalKeyKindRangeKeySet ,
492+ InternalKeyKindSpanStart , InternalKeyKindSpanEnd :
480493 return true
481494 default :
482495 return false
0 commit comments