Commit cee5c13
fix(storage): translate the LMDB compression descriptor for RocksDB stores
Harper's `storage.compression` - and the `compression` descriptor persisted on a
table's primary attribute - describe LMDB's per-value compression:
`{ startingOffset, threshold, dictionary }`. That value was passed straight
through to every RocksDB store open. rocksdb-js ignored it until 2.6.0, which
gives `compression` a real meaning (block/blob algorithm) and validates it. 2.6.1
accepts the descriptor object as "unset", but an unset `storage.compression`
resolves to `''` and throws `Unsupported compression algorithm ""`, and the
booleans throw as a malformed option. Every table open throws, taking component
loading and the status table down with it.
Translate at openRocksDatabase, the single point every RocksDB store opens, so
re-opens of existing tables - whose persisted descriptor is LMDB-shaped - are
covered along with new ones. `''`, `true` and the LMDB descriptor leave the
option unset and take rocksdb-js's own default of lz4 (naming lz4 explicitly
would throw on a build without it); `storage.compression: false` maps to 'none';
an algorithm name or { algorithm, level } passes through.
The 2.6 binaries link lz4/zstd/bzip2 for the first time - 2.5.0 exported no
`supportedCompression` and its binary carries no LZ4_compress/ZSTD_compress - so
RocksDB stores were uncompressed until now. `false` therefore preserves today's
behavior and the default (lz4) is the change worth a release note.
main pinned `^2.5.0`, which already resolved 2.6.1 for the Docker image, which
installs from a tarball and so resolves fresh from package.json rather than the
published shrinkwrap. Pin `~2.6.1` so the dependency and the translation move
together.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent c0483f5 commit cee5c13
4 files changed
Lines changed: 130 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
179 | 205 | | |
180 | 206 | | |
| 207 | + | |
181 | 208 | | |
182 | 209 | | |
183 | 210 | | |
| |||
745 | 772 | | |
746 | 773 | | |
747 | 774 | | |
748 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
749 | 778 | | |
750 | 779 | | |
751 | 780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
57 | 119 | | |
58 | 120 | | |
59 | 121 | | |
| |||
0 commit comments