@harperfast/rocksdb-js 2.11.0 → 2.12.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 +25 -16
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/docs/backups.md +27 -0
- package/docs/stats.md +7 -4
- package/docs/transaction-log.md +22 -3
- package/package.json +17 -16
package/dist/index.d.cts
CHANGED
|
@@ -178,6 +178,14 @@ export declare const backups: {
|
|
|
178
178
|
* Verifies a backup's file sizes, and optionally their checksums (which
|
|
179
179
|
* requires reading all backed-up data).
|
|
180
180
|
*
|
|
181
|
+
* Set `verifyTables: true` to also prove this build can read the backup
|
|
182
|
+
* before restoring it: every table file is opened, one at a time, and its
|
|
183
|
+
* footer (including `format_version`) and properties must be readable, and
|
|
184
|
+
* every compression algorithm it records must be supported by this build.
|
|
185
|
+
* A checksum-valid table written by a newer or differently built RocksDB
|
|
186
|
+
* otherwise passes and fails on the first read after a restore. Blob files
|
|
187
|
+
* are not checked.
|
|
188
|
+
*
|
|
181
189
|
* When the backup was created with `transactionLogs: true`, the backup's
|
|
182
190
|
* transaction log snapshot (`<backupDir>/transaction_logs/<backupId>/`) is
|
|
183
191
|
* also validated — every log file's header and entry framing must be intact
|
|
@@ -186,6 +194,7 @@ export declare const backups: {
|
|
|
186
194
|
*/
|
|
187
195
|
verify(backupDir: string, backupId: number, options?: {
|
|
188
196
|
verifyWithChecksum?: boolean;
|
|
197
|
+
verifyTables?: boolean;
|
|
189
198
|
verifyTransactionLogs?: boolean;
|
|
190
199
|
}): Promise<void>;
|
|
191
200
|
};
|
|
@@ -2016,6 +2025,7 @@ type TransactionLogStats = {
|
|
|
2016
2025
|
oldestFileAgeMs: number;
|
|
2017
2026
|
purgeableFiles: number;
|
|
2018
2027
|
retainedUnflushedFiles: number;
|
|
2028
|
+
retentionPins: number;
|
|
2019
2029
|
lastPurgeMs: number;
|
|
2020
2030
|
};
|
|
2021
2031
|
totals: {
|
package/dist/index.d.mts
CHANGED
|
@@ -178,6 +178,14 @@ export declare const backups: {
|
|
|
178
178
|
* Verifies a backup's file sizes, and optionally their checksums (which
|
|
179
179
|
* requires reading all backed-up data).
|
|
180
180
|
*
|
|
181
|
+
* Set `verifyTables: true` to also prove this build can read the backup
|
|
182
|
+
* before restoring it: every table file is opened, one at a time, and its
|
|
183
|
+
* footer (including `format_version`) and properties must be readable, and
|
|
184
|
+
* every compression algorithm it records must be supported by this build.
|
|
185
|
+
* A checksum-valid table written by a newer or differently built RocksDB
|
|
186
|
+
* otherwise passes and fails on the first read after a restore. Blob files
|
|
187
|
+
* are not checked.
|
|
188
|
+
*
|
|
181
189
|
* When the backup was created with `transactionLogs: true`, the backup's
|
|
182
190
|
* transaction log snapshot (`<backupDir>/transaction_logs/<backupId>/`) is
|
|
183
191
|
* also validated — every log file's header and entry framing must be intact
|
|
@@ -186,6 +194,7 @@ export declare const backups: {
|
|
|
186
194
|
*/
|
|
187
195
|
verify(backupDir: string, backupId: number, options?: {
|
|
188
196
|
verifyWithChecksum?: boolean;
|
|
197
|
+
verifyTables?: boolean;
|
|
189
198
|
verifyTransactionLogs?: boolean;
|
|
190
199
|
}): Promise<void>;
|
|
191
200
|
};
|
|
@@ -2016,6 +2025,7 @@ type TransactionLogStats = {
|
|
|
2016
2025
|
oldestFileAgeMs: number;
|
|
2017
2026
|
purgeableFiles: number;
|
|
2018
2027
|
retainedUnflushedFiles: number;
|
|
2028
|
+
retentionPins: number;
|
|
2019
2029
|
lastPurgeMs: number;
|
|
2020
2030
|
};
|
|
2021
2031
|
totals: {
|
package/dist/index.mjs
CHANGED
|
@@ -525,6 +525,14 @@ const backups = {
|
|
|
525
525
|
* Verifies a backup's file sizes, and optionally their checksums (which
|
|
526
526
|
* requires reading all backed-up data).
|
|
527
527
|
*
|
|
528
|
+
* Set `verifyTables: true` to also prove this build can read the backup
|
|
529
|
+
* before restoring it: every table file is opened, one at a time, and its
|
|
530
|
+
* footer (including `format_version`) and properties must be readable, and
|
|
531
|
+
* every compression algorithm it records must be supported by this build.
|
|
532
|
+
* A checksum-valid table written by a newer or differently built RocksDB
|
|
533
|
+
* otherwise passes and fails on the first read after a restore. Blob files
|
|
534
|
+
* are not checked.
|
|
535
|
+
*
|
|
528
536
|
* When the backup was created with `transactionLogs: true`, the backup's
|
|
529
537
|
* transaction log snapshot (`<backupDir>/transaction_logs/<backupId>/`) is
|
|
530
538
|
* also validated — every log file's header and entry framing must be intact
|
|
@@ -532,7 +540,9 @@ const backups = {
|
|
|
532
540
|
* is a verification failure). Set `verifyTransactionLogs: false` to skip.
|
|
533
541
|
*/
|
|
534
542
|
async verify(backupDir, backupId, options) {
|
|
535
|
-
|
|
543
|
+
const verifyTables = options?.verifyTables;
|
|
544
|
+
if (verifyTables !== void 0 && typeof verifyTables !== "boolean") throw new TypeError(`verifyTables must be a boolean, received ${verifyTables === null ? "null" : typeof verifyTables}`);
|
|
545
|
+
await new Promise((resolve, reject) => nativeBackupVerify(resolve, reject, backupDir, backupId, options?.verifyWithChecksum ?? false, verifyTables === true));
|
|
536
546
|
if (options?.verifyTransactionLogs === false) return;
|
|
537
547
|
const logsDir = join(backupDir, TRANSACTION_LOGS_DIRNAME, String(backupId));
|
|
538
548
|
if (!await exists(logsDir)) return;
|
|
@@ -3950,7 +3960,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
|
|
|
3950
3960
|
//#region src/index.ts
|
|
3951
3961
|
const versions = {
|
|
3952
3962
|
rocksdb: version,
|
|
3953
|
-
"rocksdb-js": "2.
|
|
3963
|
+
"rocksdb-js": "2.12.0"
|
|
3954
3964
|
};
|
|
3955
3965
|
|
|
3956
3966
|
//#endregion
|