@harperfast/rocksdb-js 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -11
- package/dist/index.cjs +311 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -39
- package/dist/index.d.mts +168 -39
- package/dist/index.mjs +309 -66
- package/dist/index.mjs.map +1 -1
- package/docs/performance/mutex-contention.md +4 -3
- package/docs/stats.md +4 -0
- package/docs/steady-clock-design.md +1 -1
- package/docs/transaction-log.md +5 -4
- package/package.json +16 -16
|
@@ -171,11 +171,12 @@ A separate native reproduction confirmed [#860](https://github.com/HarperFast/ro
|
|
|
171
171
|
`tryClose()` releases its written-position lock before latching admission closed.
|
|
172
172
|
A transaction can bind, finish `writeBatch()` and reduce the pending count back to zero
|
|
173
173
|
between those checks. A temporary scheduling hook before phase 3 reproduced
|
|
174
|
-
`pending=0`, one real uncommitted position, and `tryClose() == true`. This
|
|
174
|
+
`pending=0`, one real uncommitted position, and `tryClose() == true`. This was a
|
|
175
175
|
pre-existing close-protocol defect, not fixed by the completion-lock change. Its
|
|
176
176
|
production trigger is a concurrent destructive log purge; no customer incident or
|
|
177
|
-
JavaScript-level data loss was reproduced.
|
|
178
|
-
|
|
177
|
+
JavaScript-level data loss was reproduced. It is now fixed without changing the binding
|
|
178
|
+
lock: every bind advances a generation that `tryClose()` rechecks before latching (see
|
|
179
|
+
"Conditional close" in `src/binding/transaction_log/DESIGN.md`).
|
|
179
180
|
|
|
180
181
|
The investigation also found [#859](https://github.com/HarperFast/rocksdb-js/issues/859):
|
|
181
182
|
the DB-instance stress test awaits an empty promise array in its worker-close phase.
|
package/docs/stats.md
CHANGED
|
@@ -189,6 +189,10 @@ which includes all of the stats above plus the following:
|
|
|
189
189
|
| `rocksdb.blobdb.gc.num.new.files` | Number of new blob files generated by garbage collection (legacy stacked BlobDB). | ticker |
|
|
190
190
|
| `rocksdb.blobdb.get.micros` | Distribution of `Get()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
|
|
191
191
|
| `rocksdb.blobdb.key.size` | Distribution of key sizes for BlobDB operations. | histogram |
|
|
192
|
+
| `rocksdb.blobdb.lazy.partial.bytes.saved` | Bytes not read from blob files thanks to partial (byte-range) lazy reads: the value size minus the bytes actually read. | ticker |
|
|
193
|
+
| `rocksdb.blobdb.lazy.partial.read.count` | Number of lazy blob reads that read only a byte range of an uncompressed blob value. | ticker |
|
|
194
|
+
| `rocksdb.blobdb.lazy.read.bytes` | Bytes read from storage while resolving lazy wide-column results (`GetEntityLazy`/`MultiGetEntityLazy`). | ticker |
|
|
195
|
+
| `rocksdb.blobdb.lazy.read.count` | Number of storage reads issued while resolving lazy wide-column results (`GetEntityLazy`/`MultiGetEntityLazy`). | ticker |
|
|
192
196
|
| `rocksdb.blobdb.multiget.micros` | Distribution of `MultiGet()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
|
|
193
197
|
| `rocksdb.blobdb.next.micros` | Distribution of iterator `Next()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
|
|
194
198
|
| `rocksdb.blobdb.num.get` | Number of `Get()` calls (legacy stacked BlobDB). | ticker |
|
|
@@ -87,7 +87,7 @@ separate properties. No promise is made that runtime timers use the same suspend
|
|
|
87
87
|
## Verification
|
|
88
88
|
|
|
89
89
|
The end-to-end route is the real N-API export through `src/index.ts`, parent/worker bracketing on
|
|
90
|
-
Node
|
|
90
|
+
Node and Bun (Deno: local `pnpm test:deno` only, #947), staggered/restarted and concurrent workers (including `workerFirst >= parentBefore + stagger - tolerance`), elapsed
|
|
91
91
|
progression, and built ESM/CJS
|
|
92
92
|
exports. Temporarily substituting a worker-local clock must make those brackets fail, proving
|
|
93
93
|
they reject the motivating defect.
|
package/docs/transaction-log.md
CHANGED
|
@@ -58,7 +58,7 @@ The token is used to validate that the file is indeed a transaction log.
|
|
|
58
58
|
|
|
59
59
|
#### `version`
|
|
60
60
|
|
|
61
|
-
The transaction log file format version. Currently, version `1` is the latest.
|
|
61
|
+
The transaction log file format version. Currently, version `1` is the latest. Opening a database whose newest transaction-log segments include one with a higher version (written by a newer release) fails with an error naming the segment, rather than skipping it, and this release never appends after such a segment. A malformed or unreadable segment is still skipped.
|
|
62
62
|
|
|
63
63
|
#### `timestamp`
|
|
64
64
|
|
|
@@ -84,9 +84,10 @@ The size of the data entry directly following the transaction header.
|
|
|
84
84
|
|
|
85
85
|
Transaction entry related flags.
|
|
86
86
|
|
|
87
|
-
| Flag
|
|
88
|
-
|
|
|
89
|
-
| `TRANSACTION_LOG_ENTRY_LAST_FLAG`
|
|
87
|
+
| Flag | Value | Description |
|
|
88
|
+
| ------------------------------------ | ------ | --------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| `TRANSACTION_LOG_ENTRY_LAST_FLAG` | `0x01` | Indicates the last entry for a transaction |
|
|
90
|
+
| `TRANSACTION_LOG_ENTRY_ABORTED_FLAG` | `0x02` | On a transaction's first entry: the transaction did not commit, and readers skip all of its entries |
|
|
90
91
|
|
|
91
92
|
## Encoding Details
|
|
92
93
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harperfast/rocksdb-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "RocksDB binding for Node.js",
|
|
5
5
|
"homepage": "https://github.com/HarperFast/rocksdb-js",
|
|
6
6
|
"bugs": [
|
|
@@ -41,36 +41,36 @@
|
|
|
41
41
|
"@types/node": "26.6.5",
|
|
42
42
|
"@vitest/coverage-v8": "4.1.11",
|
|
43
43
|
"cross-env": "10.1.0",
|
|
44
|
-
"dotenv": "18.0.
|
|
45
|
-
"lefthook": "2.2.
|
|
46
|
-
"lmdb": "3.5.
|
|
44
|
+
"dotenv": "18.0.9",
|
|
45
|
+
"lefthook": "2.2.2",
|
|
46
|
+
"lmdb": "3.5.9",
|
|
47
47
|
"node-gyp": "13.1.0",
|
|
48
|
-
"oxfmt": "0.
|
|
49
|
-
"oxlint": "1.
|
|
48
|
+
"oxfmt": "0.75.0",
|
|
49
|
+
"oxlint": "1.90.0",
|
|
50
50
|
"prebuildify": "6.0.1",
|
|
51
51
|
"semver": "7.8.5",
|
|
52
52
|
"tar": "7.5.22",
|
|
53
|
-
"tsdown": "0.23.
|
|
53
|
+
"tsdown": "0.23.3",
|
|
54
54
|
"tslib": "2.8.1",
|
|
55
55
|
"typescript": "7.0.2",
|
|
56
56
|
"vitest": "4.1.11"
|
|
57
57
|
},
|
|
58
58
|
"optionalDependencies": {
|
|
59
|
-
"@harperfast/rocksdb-js-darwin-arm64": "2.
|
|
60
|
-
"@harperfast/rocksdb-js-darwin-x64": "2.
|
|
61
|
-
"@harperfast/rocksdb-js-linux-arm64-glibc": "2.
|
|
62
|
-
"@harperfast/rocksdb-js-linux-arm64-musl": "2.
|
|
63
|
-
"@harperfast/rocksdb-js-linux-x64-glibc": "2.
|
|
64
|
-
"@harperfast/rocksdb-js-linux-x64-musl": "2.
|
|
65
|
-
"@harperfast/rocksdb-js-win32-arm64": "2.
|
|
66
|
-
"@harperfast/rocksdb-js-win32-x64": "2.
|
|
59
|
+
"@harperfast/rocksdb-js-darwin-arm64": "2.13.0",
|
|
60
|
+
"@harperfast/rocksdb-js-darwin-x64": "2.13.0",
|
|
61
|
+
"@harperfast/rocksdb-js-linux-arm64-glibc": "2.13.0",
|
|
62
|
+
"@harperfast/rocksdb-js-linux-arm64-musl": "2.13.0",
|
|
63
|
+
"@harperfast/rocksdb-js-linux-x64-glibc": "2.13.0",
|
|
64
|
+
"@harperfast/rocksdb-js-linux-x64-musl": "2.13.0",
|
|
65
|
+
"@harperfast/rocksdb-js-win32-arm64": "2.13.0",
|
|
66
|
+
"@harperfast/rocksdb-js-win32-x64": "2.13.0"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": "^22.18.0 || >=24.0.0"
|
|
70
70
|
},
|
|
71
71
|
"gypfile": true,
|
|
72
72
|
"rocksdb": {
|
|
73
|
-
"version": "11.
|
|
73
|
+
"version": "11.12.0"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"bench": "cross-env CI=1 node --expose-gc ./node_modules/vitest/vitest.mjs bench --passWithNoTests --outputJson benchmark-results.json",
|