@harperfast/rocksdb-js 2.9.0 → 2.9.1
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 +20 -8
- package/dist/index.cjs +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -4
- package/dist/index.d.mts +10 -4
- package/dist/index.mjs +20 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -95,10 +95,20 @@ Creates a new database instance.
|
|
|
95
95
|
- `maxWriteBufferSizeToMaintain: number` The number of bytes of recent memtable history to keep in
|
|
96
96
|
memory for transaction conflict checking. `-1` (the default) derives the value from
|
|
97
97
|
`maxWriteBufferNumber * writeBufferSize` (the RocksDB-recommended default for optimistic
|
|
98
|
-
transactions) — except when a
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
transactions) — except when the database has a [`writeBufferManager`](#dbconfigoptions)
|
|
99
|
+
attached, in which case it resolves to `1` so the manager is not filled with history it will
|
|
100
|
+
never release. What decides this is the manager the database itself holds, not the current
|
|
101
|
+
`writeBufferManagerSize`: a column family created later on an already-open database is clamped
|
|
102
|
+
too, because its history is still charged to that manager. It also applies to any attached
|
|
103
|
+
manager, not only a stalling one — `writeBufferManagerAllowStall` can be changed at runtime
|
|
104
|
+
while this value is fixed when a column family is created, and history the budget cannot reclaim
|
|
105
|
+
is a problem either way. `1` is the smallest target a transactional database can be given: RocksDB's transaction wrappers rewrite a `0` target to
|
|
106
|
+
the derived value, so `0` requests the _largest_ history rather than none, and an explicitly
|
|
107
|
+
requested `0` is normalized to `1` for the same reason. A positive target still retains the most
|
|
108
|
+
recent flushed memtable per column family until that family's next write. An explicit positive
|
|
109
|
+
value is honored as-is; sizing it against the budget and the column-family count is then yours,
|
|
110
|
+
and a configuration whose known families already reach the budget is reported on the
|
|
111
|
+
[`'log.warn'`](#event-api) channel.
|
|
102
112
|
- `name: string` The column family name. Defaults to `"default"`.
|
|
103
113
|
- `noBlockCache: boolean` When `true`, disables the block cache. Block caching is enabled by
|
|
104
114
|
default and the cache is shared across all database instances.
|
|
@@ -236,8 +246,10 @@ Sets global database settings.
|
|
|
236
246
|
back into the reclaimed space. Defaults to `false`.
|
|
237
247
|
- `writeBufferManagerSize: number` Total memtable memory limit (bytes) shared across every
|
|
238
248
|
database opened in this process. When set, RocksDB uses a single `WriteBufferManager` so write
|
|
239
|
-
buffers are bounded process-wide rather than per database.
|
|
240
|
-
|
|
249
|
+
buffers are bounded process-wide rather than per database. Defaults to `0`, which means no
|
|
250
|
+
manager. Setting `0` later stops _new_ opens from attaching one, but does not detach or resize
|
|
251
|
+
the manager a database already holds — `write_buffer_manager` is fixed for the life of an open
|
|
252
|
+
database, so its memtables stay charged against that budget.
|
|
241
253
|
|
|
242
254
|
```typescript
|
|
243
255
|
RocksDatabase.config({
|
|
@@ -1148,8 +1160,8 @@ uses this timestamp as the batch key; producers may also encode it into their ow
|
|
|
1148
1160
|
|
|
1149
1161
|
Type: `number`
|
|
1150
1162
|
|
|
1151
|
-
The transaction ID
|
|
1152
|
-
RocksDB database path, regardless the database name/column family.
|
|
1163
|
+
The transaction ID, a positive integer no greater than `Number.MAX_SAFE_INTEGER`. Transaction IDs
|
|
1164
|
+
are unique to the RocksDB database path, regardless the database name/column family.
|
|
1153
1165
|
|
|
1154
1166
|
#### `txn.setTimestamp(ts?: number): void`
|
|
1155
1167
|
|
package/dist/index.cjs
CHANGED
|
@@ -1293,7 +1293,15 @@ var DBIterator = class {
|
|
|
1293
1293
|
this.iterator.return?.();
|
|
1294
1294
|
return DONE_RESULT;
|
|
1295
1295
|
}
|
|
1296
|
-
|
|
1296
|
+
let result;
|
|
1297
|
+
try {
|
|
1298
|
+
result = this.iterator.next();
|
|
1299
|
+
} catch (err) {
|
|
1300
|
+
try {
|
|
1301
|
+
this.iterator.return?.();
|
|
1302
|
+
} catch {}
|
|
1303
|
+
throw err;
|
|
1304
|
+
}
|
|
1297
1305
|
if (result === ITERATOR_RESULT_DONE) return DONE_RESULT;
|
|
1298
1306
|
this.#yielded++;
|
|
1299
1307
|
const includeValues = this.#includeValues;
|
|
@@ -1571,10 +1579,16 @@ var Store = class {
|
|
|
1571
1579
|
/**
|
|
1572
1580
|
* The bytes of recent memtable history to retain in memory for transaction
|
|
1573
1581
|
* conflict checking. `-1` derives the value from
|
|
1574
|
-
* `maxWriteBufferNumber * writeBufferSize`, except
|
|
1575
|
-
* `writeBufferManager
|
|
1576
|
-
* that manager and is only trimmable down to this target, so a
|
|
1577
|
-
* budget cannot hold
|
|
1582
|
+
* `maxWriteBufferNumber * writeBufferSize`, except when a
|
|
1583
|
+
* `writeBufferManager` is configured, where it derives `1`: retained history
|
|
1584
|
+
* is charged to that manager and is only trimmable down to this target, so a
|
|
1585
|
+
* target the budget cannot hold is memory the manager never reclaims, and
|
|
1586
|
+
* stalls writes permanently when `writeBufferManagerAllowStall` is on. Any
|
|
1587
|
+
* configured manager, not only a stalling one — that flag is mutable at
|
|
1588
|
+
* runtime while this value is fixed when the family is created. `1`, not `0`, because
|
|
1589
|
+
* RocksDB's transaction wrappers rewrite a `0` target to the derived value —
|
|
1590
|
+
* so `0` asks for the largest history rather than none, and an explicit `0`
|
|
1591
|
+
* is normalized to `1` for that reason. Set a positive number to size it
|
|
1578
1592
|
* yourself against the budget and the column-family count.
|
|
1579
1593
|
*/
|
|
1580
1594
|
maxWriteBufferSizeToMaintain;
|
|
@@ -3789,7 +3803,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
|
|
|
3789
3803
|
//#region src/index.ts
|
|
3790
3804
|
const versions = {
|
|
3791
3805
|
rocksdb: version,
|
|
3792
|
-
"rocksdb-js": "2.9.
|
|
3806
|
+
"rocksdb-js": "2.9.1"
|
|
3793
3807
|
};
|
|
3794
3808
|
|
|
3795
3809
|
//#endregion
|