Skip to content

Commit d3bef26

Browse files
committed
sstable: remove CompressionOptions
This property is never used; we just write a fixed value for RocksDB compatibility. This commit removes the property and writes it out in a special code path with other rocksdb-speific properties, only when the table format is an old rocksdb version.
1 parent 2d7040f commit d3bef26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1110
-1167
lines changed

replay/testdata/corpus/simple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ simple/MANIFEST-000001:
8080
size: 133
8181
simple/MANIFEST-000008: stat simple/MANIFEST-000008: file does not exist
8282
simple/000007.sst:
83-
size: 614
83+
size: 508

replay/testdata/corpus/simple_ingest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ simple_ingest/MANIFEST-000008:
101101
size: 209
102102
simple_ingest/MANIFEST-000010: stat simple_ingest/MANIFEST-000010: file does not exist
103103
simple_ingest/000007.sst:
104-
size: 765
104+
size: 661
105105
simple_ingest/000009.sst:
106-
size: 759
106+
size: 655

replay/testdata/corpus/simple_val_sep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ stat simple_val_sep/MANIFEST-000013 simple_val_sep/000015.sst simple_val_sep/000
103103
simple_val_sep/MANIFEST-000013:
104104
size: 250
105105
simple_val_sep/000015.sst:
106-
size: 873
106+
size: 760
107107
simple_val_sep/000016.blob:
108108
size: 97

replay/testdata/replay

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ tree
66
/
77
build/
88
89 000004.log
9-
586 000005.sst
9+
480 000005.sst
1010
49 000006.log
11-
614 000007.sst
11+
508 000007.sst
1212
0 LOCK
1313
133 MANIFEST-000001
1414
2799 OPTIONS-000003
1515
0 marker.format-version.000001.013
1616
0 marker.manifest.000001.MANIFEST-000001
1717
simple/
18-
614 000007.sst
18+
508 000007.sst
1919
133 MANIFEST-000001
2020
checkpoint/
2121
25 000004.log
22-
586 000005.sst
22+
480 000005.sst
2323
85 MANIFEST-000001
2424
2799 OPTIONS-000003
2525
0 marker.format-version.000001.013

replay/testdata/replay_ingest

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ tree
66
/
77
build/
88
36 000002.log
9-
765 000005.sst
10-
765 000007.sst
11-
759 000009.sst
9+
661 000005.sst
10+
661 000007.sst
11+
655 000009.sst
1212
0 LOCK
1313
172 MANIFEST-000001
1414
209 MANIFEST-000008
1515
2800 OPTIONS-000003
1616
0 marker.format-version.000012.025
1717
0 marker.manifest.000002.MANIFEST-000008
1818
simple_ingest/
19-
765 000007.sst
20-
759 000009.sst
19+
661 000007.sst
20+
655 000009.sst
2121
172 MANIFEST-000001
2222
209 MANIFEST-000008
2323
checkpoint/
2424
25 000002.log
25-
782 000004.sst
26-
765 000005.sst
25+
678 000004.sst
26+
661 000005.sst
2727
172 MANIFEST-000001
2828
2800 OPTIONS-000003
2929
0 marker.format-version.000001.025
@@ -158,7 +158,7 @@ replay simple_ingest unpaced
158158

159159
wait
160160
----
161-
replayed 1.5KB in writes
161+
replayed 1.3KB in writes
162162

163163
scan-keys
164164
----

replay/testdata/replay_paced

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ tree
55
----
66
/
77
build/
8-
864 000005.sst
9-
560 000007.sst
8+
758 000005.sst
9+
454 000007.sst
1010
89 000008.log
11-
560 000009.sst
11+
454 000009.sst
1212
200 000011.log
13-
614 000012.sst
13+
508 000012.sst
1414
0 LOCK
1515
133 MANIFEST-000001
1616
205 MANIFEST-000010
1717
2799 OPTIONS-000003
1818
0 marker.format-version.000001.013
1919
0 marker.manifest.000002.MANIFEST-000010
2020
high_read_amp/
21-
614 000012.sst
21+
508 000012.sst
2222
205 MANIFEST-000010
2323
checkpoint/
24-
864 000005.sst
25-
560 000007.sst
24+
758 000005.sst
25+
454 000007.sst
2626
39 000008.log
27-
560 000009.sst
27+
454 000009.sst
2828
157 MANIFEST-000010
2929
2799 OPTIONS-000003
3030
0 marker.format-version.000001.013

replay/testdata/replay_val_sep

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ tree
55
----
66
/
77
build/
8-
900 000005.sst
8+
787 000005.sst
99
101 000006.blob
10-
879 000008.sst
10+
766 000008.sst
1111
97 000009.blob
1212
92 000011.log
13-
764 000012.sst
13+
660 000012.sst
1414
63 000014.log
15-
873 000015.sst
15+
760 000015.sst
1616
97 000016.blob
1717
0 LOCK
1818
152 MANIFEST-000010
@@ -21,16 +21,16 @@ tree
2121
0 marker.format-version.000011.024
2222
0 marker.manifest.000003.MANIFEST-000013
2323
simple_val_sep/
24-
873 000015.sst
24+
760 000015.sst
2525
97 000016.blob
2626
250 MANIFEST-000013
2727
checkpoint/
28-
900 000005.sst
28+
787 000005.sst
2929
101 000006.blob
30-
879 000008.sst
30+
766 000008.sst
3131
97 000009.blob
3232
64 000011.log
33-
764 000012.sst
33+
660 000012.sst
3434
187 MANIFEST-000013
3535
2936 OPTIONS-000003
3636
0 marker.format-version.000001.024

sstable/colblk_writer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,6 @@ func (w *RawColumnWriter) Close() (err error) {
10331033

10341034
w.props.CompressionStats = w.layout.physBlockMaker.Compressor.Stats().String()
10351035
var toWrite []byte
1036-
w.props.CompressionOptions = rocksDBCompressionOptions
10371036
if w.opts.TableFormat >= TableFormatPebblev7 {
10381037
var cw colblk.KeyValueBlockWriter
10391038
cw.Init()

sstable/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var ignoredInternalProperties = map[string]struct{}{
3838
"rocksdb.creation.time": {},
3939
"rocksdb.file.creation.time": {},
4040
"rocksdb.format.version": {},
41+
"rocksdb.compression_options": {},
4142
}
4243

4344
// FilterType exports the base.FilterType type.

sstable/properties.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ type CommonProperties struct {
117117
NumTombstoneDenseBlocks uint64 `prop:"pebble.num.tombstone-dense-blocks"`
118118
// The compression algorithm used to compress blocks.
119119
CompressionName string `prop:"rocksdb.compression"`
120-
// The compression options used to compress blocks.
121-
CompressionOptions string `prop:"rocksdb.compression_options"`
122120
}
123121

124122
// String is only used for testing purposes.
@@ -401,9 +399,6 @@ func (p *Properties) accumulateProps(tblFormat TableFormat) ([]string, map[strin
401399
if p.CompressionName != "" {
402400
p.saveString(m, unsafe.Offsetof(p.CompressionName), p.CompressionName)
403401
}
404-
if p.CompressionOptions != "" {
405-
p.saveString(m, unsafe.Offsetof(p.CompressionOptions), p.CompressionOptions)
406-
}
407402
p.saveUvarint(m, unsafe.Offsetof(p.DataSize), p.DataSize)
408403
if p.FilterPolicyName != "" {
409404
p.saveString(m, unsafe.Offsetof(p.FilterPolicyName), p.FilterPolicyName)
@@ -486,6 +481,7 @@ func (p *Properties) accumulateProps(tblFormat TableFormat) ([]string, map[strin
486481
m["rocksdb.oldest.key.time"] = singleZeroSlice
487482
m["rocksdb.creation.time"] = singleZeroSlice
488483
m["rocksdb.format.version"] = singleZeroSlice
484+
m["rocksdb.compression_options"] = rocksDBCompressionOptions
489485
}
490486

491487
keys := slices.Collect(maps.Keys(m))
@@ -554,4 +550,8 @@ func (p *Properties) toAttributes() Attributes {
554550
var (
555551
singleZeroSlice = []byte{0x00}
556552
maxInt32Slice = binary.AppendUvarint([]byte(nil), math.MaxInt32)
553+
554+
// RocksDB always includes this in the properties block, so we include it for
555+
// formats below TableFormatPebble.
556+
rocksDBCompressionOptions = []byte("window_bits=-14; level=32767; strategy=0; max_dict_bytes=0; zstd_max_train_bytes=0; enabled=0; ")
557557
)

0 commit comments

Comments
 (0)