@cloudbitmaps/core 0.4.1 → 0.5.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/dist/index.cjs +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -7
- package/dist/index.d.ts +19 -7
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/mysql/index.cjs.map +1 -1
- package/dist/mysql/index.js.map +1 -1
- package/dist/postgres/index.cjs.map +1 -1
- package/dist/postgres/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2218,6 +2218,10 @@ async function publishGeneration(registry, key, options = {}) {
|
|
|
2218
2218
|
currentGen: key.generation,
|
|
2219
2219
|
wrappedDeks: options.wrappedDeks
|
|
2220
2220
|
});
|
|
2221
|
+
} else if (record.status === "destroyed") {
|
|
2222
|
+
throw new ValidationError(
|
|
2223
|
+
`segment "${key.segment}" was destroyed (crypto-shredded) while generation ${key.generation} was being written \u2014 refusing to publish it; the written object is unreadable. Use a new segment.`
|
|
2224
|
+
);
|
|
2221
2225
|
} else if (record.currentGen > key.generation) {
|
|
2222
2226
|
return false;
|
|
2223
2227
|
} else if (record.currentGen === key.generation) {
|
|
@@ -4046,12 +4050,13 @@ async function shredSegment(ref, deps, allowCleartext) {
|
|
|
4046
4050
|
}
|
|
4047
4051
|
async function eraseWarm(warm, ref) {
|
|
4048
4052
|
let deleted = 0;
|
|
4053
|
+
let conflicts = 0;
|
|
4049
4054
|
for (let pass = 0; pass < MAX_WARM_PASSES; pass++) {
|
|
4055
|
+
conflicts = 0;
|
|
4050
4056
|
const rows = [];
|
|
4051
4057
|
for await (const row of warm.listChunks(ref))
|
|
4052
4058
|
rows.push({ chunkKey: row.chunkKey, token: row.token });
|
|
4053
4059
|
if (rows.length === 0) break;
|
|
4054
|
-
let conflicts = 0;
|
|
4055
4060
|
for (const { chunkKey, token } of rows) {
|
|
4056
4061
|
const chunkRef = { namespace: ref.namespace, segment: ref.segment, chunkKey };
|
|
4057
4062
|
try {
|
|
@@ -4064,6 +4069,11 @@ async function eraseWarm(warm, ref) {
|
|
|
4064
4069
|
}
|
|
4065
4070
|
if (conflicts === 0) break;
|
|
4066
4071
|
}
|
|
4072
|
+
if (conflicts > 0) {
|
|
4073
|
+
throw new WriteConflictError(
|
|
4074
|
+
`destroySegment: ${conflicts} warm row(s) of "${ref.segment}" were rewritten during every one of ${MAX_WARM_PASSES} erase passes \u2014 the segment was NOT destroyed and its cleartext warm deltas are still readable. Stop writes to this segment and retry.`
|
|
4075
|
+
);
|
|
4076
|
+
}
|
|
4067
4077
|
return deleted;
|
|
4068
4078
|
}
|
|
4069
4079
|
|
|
@@ -4194,11 +4204,15 @@ var RetryingWarmDriver = class {
|
|
|
4194
4204
|
this.deps
|
|
4195
4205
|
);
|
|
4196
4206
|
if (started.first.done === true) return;
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4207
|
+
try {
|
|
4208
|
+
yield started.first.value;
|
|
4209
|
+
for (; ; ) {
|
|
4210
|
+
const next = await started.iterator.next();
|
|
4211
|
+
if (next.done === true) return;
|
|
4212
|
+
yield next.value;
|
|
4213
|
+
}
|
|
4214
|
+
} finally {
|
|
4215
|
+
await started.iterator.return?.();
|
|
4202
4216
|
}
|
|
4203
4217
|
}
|
|
4204
4218
|
};
|