Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colblk: don't require the header size for KeySchemaHeader #4100

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/crdbtest/crdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,11 @@ func (ks *cockroachKeySeeker) init(d *colblk.DataBlockDecoder) {
ks.mvccWallTimes = bd.Uints(cockroachColMVCCWallTime)
ks.mvccLogical = bd.Uints(cockroachColMVCCLogical)
ks.untypedVersions = bd.RawBytes(cockroachColUntypedVersion)
ks.suffixTypes = suffixTypes(d.KeySchemaHeader(1)[0])
header := d.KeySchemaHeader()
if len(header) != 1 {
panic(errors.AssertionFailedf("invalid key schema-specific header %x", header))
}
ks.suffixTypes = suffixTypes(header[0])
}

// IsLowerBound is part of the KeySeeker interface.
Expand Down
6 changes: 3 additions & 3 deletions sstable/colblk/data_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,9 @@ func (d *DataBlockDecoder) PrefixChanged() Bitmap {
return d.prefixChanged
}

// KeySchemaHeader returns the KeySchema-specific header of fixed size.
func (d *DataBlockDecoder) KeySchemaHeader(schemaHeaderSize uint32) []byte {
return d.d.data[:schemaHeaderSize]
// KeySchemaHeader returns the KeySchema-specific header.
func (d *DataBlockDecoder) KeySchemaHeader() []byte {
return d.d.data[:d.d.customHeaderSize-dataBlockCustomHeaderSize]
}

// Init initializes the data block reader with the given serialized data block.
Expand Down
Loading