@ref0/git 0.12.0 → 0.14.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/access/private-refs.mjs +3 -3
- package/dist/auth/auth.d.mts +2 -2
- package/dist/auth/auth.mjs +3 -6
- package/dist/auth/authorize.mjs +1 -17
- package/dist/auth/helpers.mjs +3 -11
- package/dist/auth/host-services.mjs +11 -0
- package/dist/auth/policy.d.mts +27 -7
- package/dist/auth/policy.mjs +8 -4
- package/dist/auth/tokens-layer.d.mts +1 -2
- package/dist/auth/tokens-layer.mjs +2 -3
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens.d.mts +1 -8
- package/dist/auth/tokens.mjs +1 -8
- package/dist/auth.d.mts +1 -4
- package/dist/auth.mjs +1 -3
- package/dist/client/git-http.mjs +18 -4
- package/dist/client/push-upload.mjs +33 -7
- package/dist/client/remote.mjs +94 -28
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/contracts/access.d.mts +8 -8
- package/dist/contracts/actors.d.mts +2 -34
- package/dist/contracts/blobs.d.mts +2 -2
- package/dist/contracts/client.d.mts +8 -3
- package/dist/contracts/commits.d.mts +10 -2
- package/dist/contracts/commits.mjs +9 -1
- package/dist/contracts/files.d.mts +2 -2
- package/dist/contracts/forks.d.mts +11 -1
- package/dist/contracts/git.d.mts +18 -7
- package/dist/contracts/git.mjs +3 -2
- package/dist/contracts/lfs.d.mts +0 -7
- package/dist/contracts/objects.d.mts +80 -10
- package/dist/contracts/operations.d.mts +3 -0
- package/dist/contracts/operations.mjs +12 -2
- package/dist/contracts/push-uploads.d.mts +44 -5
- package/dist/contracts/push-uploads.mjs +7 -3
- package/dist/contracts/refs.d.mts +28 -6
- package/dist/contracts/remote.mjs +1 -3
- package/dist/contracts/repo-records.d.mts +1 -0
- package/dist/contracts/repos.d.mts +90 -2
- package/dist/contracts/repos.mjs +29 -2
- package/dist/contracts/result.d.mts +23 -18
- package/dist/contracts/result.mjs +17 -4
- package/dist/contracts/rules.d.mts +22 -22
- package/dist/contracts/server.d.mts +28 -77
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/sync.d.mts +79 -19
- package/dist/contracts/sync.mjs +34 -10
- package/dist/contracts/tokens.d.mts +1 -6
- package/dist/contracts/tokens.mjs +1 -2
- package/dist/contracts/topics.d.mts +0 -5
- package/dist/contracts/work.d.mts +66 -2
- package/dist/contracts/work.mjs +8 -1
- package/dist/core/access.mjs +27 -5
- package/dist/core/ancestry.d.mts +9 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +42 -4
- package/dist/core/call-names.mjs +1 -0
- package/dist/core/call-services.mjs +2 -1
- package/dist/core/events/deliver.mjs +10 -2
- package/dist/core/forks.mjs +3 -3
- package/dist/core/imports.mjs +147 -9
- package/dist/core/index-job.mjs +9 -6
- package/dist/core/job-view.mjs +8 -9
- package/dist/core/mirror-rows.mjs +19 -4
- package/dist/core/objects/commits.mjs +16 -6
- package/dist/core/parts.d.mts +6 -1
- package/dist/core/parts.mjs +1 -4
- package/dist/core/purge.mjs +76 -6
- package/dist/core/push-decide.mjs +1 -1
- package/dist/core/push-files.d.mts +12 -0
- package/dist/core/push-files.mjs +225 -0
- package/dist/core/push-repo.d.mts +8 -0
- package/dist/core/push-repo.mjs +56 -0
- package/dist/core/push.d.mts +17 -0
- package/dist/core/push.mjs +98 -26
- package/dist/core/receipts.mjs +26 -10
- package/dist/core/ref-view.mjs +59 -5
- package/dist/core/refs.mjs +13 -8
- package/dist/core/repack.mjs +11 -8
- package/dist/core/repo-info.mjs +16 -9
- package/dist/core/repos.mjs +30 -14
- package/dist/core/seam.mjs +2 -2
- package/dist/core/view.d.mts +6 -0
- package/dist/core/view.mjs +45 -12
- package/dist/core/work.mjs +47 -22
- package/dist/effect.d.mts +3 -1
- package/dist/effect.mjs +3 -1
- package/dist/engine/reads.mjs +13 -6
- package/dist/engine/walk.mjs +4 -4
- package/dist/event-streams/event-streams.d.mts +1 -1
- package/dist/event-streams/event-streams.mjs +1 -1
- package/dist/event-streams/stream.d.mts +1 -1
- package/dist/event-streams/stream.mjs +1 -1
- package/dist/extend.d.mts +3 -3
- package/dist/extend.mjs +2 -2
- package/dist/http/answers.mjs +4 -2
- package/dist/http/core-parts.mjs +64 -15
- package/dist/http/handler.mjs +2 -2
- package/dist/http/node.mjs +5 -4
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-upload-job.mjs +503 -0
- package/dist/http/push-uploads.d.mts +1 -0
- package/dist/http/push-uploads.mjs +114 -56
- package/dist/http/upload-pack.mjs +7 -6
- package/dist/index.d.mts +23 -24
- package/dist/index.mjs +4 -7
- package/dist/lfs/base.d.mts +7 -3
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/copy.d.mts +46 -0
- package/dist/lfs/copy.mjs +26 -0
- package/dist/lfs/layer.mjs +4 -2
- package/dist/lfs/objects.d.mts +6 -0
- package/dist/lfs/objects.mjs +68 -41
- package/dist/lfs/rows.d.mts +13 -0
- package/dist/lfs/service.d.mts +1 -7
- package/dist/lfs/service.mjs +1 -9
- package/dist/lfs/upload-most.mjs +5 -5
- package/dist/node.d.mts +2 -2
- package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
- package/dist/protocol/bytes/sha256.d.mts +32 -0
- package/dist/protocol/bytes/sha256.mjs +105 -49
- package/dist/protocol/wire/advertisement.mjs +9 -4
- package/dist/protocol/wire/lines.d.mts +4 -2
- package/dist/protocol/wire/lines.mjs +11 -5
- package/dist/protocol/wire/push-uploads.mjs +13 -1
- package/dist/protocol/wire/v2.mjs +2 -2
- package/dist/protocol.d.mts +3 -1
- package/dist/protocol.mjs +3 -1
- package/dist/queue/advance.mjs +1 -1
- package/dist/queue/host.d.mts +1 -7
- package/dist/queue/host.mjs +1 -7
- package/dist/queue/layer.mjs +1 -1
- package/dist/queue/trim.mjs +1 -1
- package/dist/rest/blobs.d.mts +31 -23
- package/dist/rest/blobs.mjs +1 -1
- package/dist/rest/caller.d.mts +49 -9
- package/dist/rest/caller.mjs +1 -1
- package/dist/rest/client.d.mts +10 -3
- package/dist/rest/client.mjs +4 -0
- package/dist/rest/commits.d.mts +273 -240
- package/dist/rest/errors.d.mts +24 -4
- package/dist/rest/events.d.mts +9 -6
- package/dist/rest/events.mjs +1 -2
- package/dist/rest/files.d.mts +127 -115
- package/dist/rest/forks.d.mts +121 -97
- package/dist/rest/handler.mjs +4 -57
- package/dist/rest/handlers.d.mts +1 -1
- package/dist/rest/handlers.mjs +18 -4
- package/dist/rest/layer.mjs +2 -1
- package/dist/rest/me.d.mts +8 -4
- package/dist/rest/merges.d.mts +8 -4
- package/dist/rest/paths.mjs +1 -0
- package/dist/rest/queue.d.mts +282 -226
- package/dist/rest/refs.d.mts +205 -176
- package/dist/rest/repos.d.mts +108 -80
- package/dist/rest/tags.d.mts +24 -12
- package/dist/rest/tokens.d.mts +235 -211
- package/dist/rest/topics.d.mts +53 -33
- package/dist/rest/trees.d.mts +105 -89
- package/dist/rest/work.d.mts +467 -20
- package/dist/rest/work.mjs +8 -0
- package/dist/server/edge-node.d.mts +9 -13
- package/dist/server/edge-node.mjs +9 -12
- package/dist/server/git-layer.d.mts +1 -6
- package/dist/server/git-layer.mjs +2 -2
- package/dist/server/git-namespace.d.mts +3 -3
- package/dist/server/joined.d.mts +15 -22
- package/dist/server/joined.mjs +5 -29
- package/dist/server/lifecycle.mjs +107 -23
- package/dist/server/registry.mjs +9 -1
- package/dist/server/server.mjs +133 -212
- package/dist/storage/budget.mjs +2 -2
- package/dist/storage/clean-up.mjs +13 -10
- package/dist/storage/fetch.mjs +13 -8
- package/dist/storage/file-limits.mjs +24 -0
- package/dist/storage/index-build.d.mts +1 -0
- package/dist/storage/index-build.mjs +106 -62
- package/dist/storage/index-fetch.mjs +16 -3
- package/dist/storage/index-reach.mjs +33 -5
- package/dist/storage/index-remap.mjs +8 -1
- package/dist/storage/index-shallow.mjs +5 -3
- package/dist/storage/largest-files.mjs +48 -0
- package/dist/storage/lfs-pointers.mjs +10 -1
- package/dist/storage/loose.mjs +3 -1
- package/dist/storage/memory-budget.mjs +28 -4
- package/dist/storage/pack-reads.mjs +8 -8
- package/dist/storage/pack-receive.mjs +83 -25
- package/dist/storage/packs.mjs +37 -21
- package/dist/storage/prune-keep.mjs +203 -34
- package/dist/storage/prune-walk.mjs +54 -16
- package/dist/storage/prune.mjs +629 -196
- package/dist/storage/push-uploads.mjs +36 -12
- package/dist/storage/quarantine.mjs +9 -9
- package/dist/storage/ready.mjs +47 -19
- package/dist/storage/receive-bounds.mjs +29 -8
- package/dist/storage/receive-state.mjs +8 -0
- package/dist/storage/receive-steps.mjs +71 -18
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +1 -8
- package/dist/storage/rows.mjs +12 -1
- package/dist/storage/shallow.d.mts +1 -0
- package/dist/storage/shallow.mjs +26 -4
- package/dist/storage/stream-whole.mjs +5 -2
- package/dist/storage/visible.mjs +29 -1
- package/dist/storage/walk.mjs +2 -1
- package/dist/store/catalogue.mjs +1 -0
- package/dist/store/cursor-seal-namespace.d.mts +2 -0
- package/dist/store/cursor-seal-public.d.mts +5 -0
- package/dist/store/cursor-seal-public.mjs +5 -0
- package/dist/store/cursor-seal.d.mts +16 -2
- package/dist/store/cursor-seal.mjs +26 -14
- package/dist/store/errors.mjs +9 -1
- package/dist/store/records.d.mts +2 -0
- package/dist/store/records.mjs +9 -6
- package/dist/store/repo-record.d.mts +9 -7
- package/dist/store/repo-record.mjs +102 -19
- package/dist/store/scopes.mjs +10 -2
- package/dist/sync/bound.d.mts +2 -0
- package/dist/sync/bound.mjs +11 -2
- package/dist/sync/github.d.mts +6 -1
- package/dist/sync/github.mjs +55 -43
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +1 -0
- package/dist/sync/layer.mjs +6 -2
- package/dist/sync/lfs-batch.mjs +119 -0
- package/dist/sync/lfs-copy.mjs +251 -0
- package/dist/sync/mirror.mjs +210 -137
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +25 -5
- package/dist/sync/tries.mjs +45 -14
- package/dist/sync.d.mts +2 -2
- package/dist/topics/host.mjs +1 -19
- package/dist/topics/layer.mjs +1 -1
- package/package.json +3 -8
- package/dist/auth/bridge.mjs +0 -30
- package/dist/auth/helpers.d.mts +0 -17
- package/dist/core/purge.d.mts +0 -8
- package/dist/core/registered-rows.d.mts +0 -5
- package/dist/core/repack.d.mts +0 -11
- package/dist/http/handler.d.mts +0 -2
- package/dist/rest/handler.d.mts +0 -21
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -1
- package/dist/server/registry.d.mts +0 -16
- package/dist/server/server.d.mts +0 -36
- package/dist/storage/repack-job.d.mts +0 -3
- package/dist/topics/host.d.mts +0 -7
|
@@ -265,8 +265,9 @@ const indexShallow = /* @__PURE__ */ Effect.fnUntraced(function* (walk, request)
|
|
|
265
265
|
});
|
|
266
266
|
/** What it held, given back, but for the lines it returns: nothing, when it held nothing. */
|
|
267
267
|
const given = Effect.suspend(() => Effect.andThen(heldBytes > 0 ? read.release(heldBytes) : Effect.void, readsHeld > 0 ? read.letGoReads(readsHeld) : Effect.void));
|
|
268
|
-
const
|
|
269
|
-
const clientShallows = new Set(
|
|
268
|
+
const held = yield* clientShallowsOf(request.shallows);
|
|
269
|
+
const clientShallows = new Set(held.map((shallow) => shallow.oid));
|
|
270
|
+
const shallows = held.filter((shallow) => !read.roots.has(shallow.oid));
|
|
270
271
|
const depth = request.depth;
|
|
271
272
|
if (depth === void 0) {
|
|
272
273
|
yield* given;
|
|
@@ -297,7 +298,8 @@ const indexShallow = /* @__PURE__ */ Effect.fnUntraced(function* (walk, request)
|
|
|
297
298
|
yield* keep(2 * (edge.numbers.length + edge.extras.length) * 70);
|
|
298
299
|
const edgeOids = yield* oidsOf(edge);
|
|
299
300
|
const unshallowed = shallows.filter((shallow) => hasMet(within, shallow));
|
|
300
|
-
const
|
|
301
|
+
const unshallowedIds = new Set(unshallowed.map((shallow) => shallow.oid));
|
|
302
|
+
const kept = [...clientShallows].filter((oid) => !unshallowedIds.has(oid));
|
|
301
303
|
const starts = yield* startsOf(unshallowed);
|
|
302
304
|
yield* given;
|
|
303
305
|
return {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A receive's largest blobs, as they're settled: a blob no larger than the smallest of a full list
|
|
3
|
+
* costs one compare, so a push of many small files keeps nothing.
|
|
4
|
+
*/
|
|
5
|
+
var LargestFiles = class {
|
|
6
|
+
#kept = [];
|
|
7
|
+
#least = 0;
|
|
8
|
+
#partial = false;
|
|
9
|
+
/** A list going on from `from`, what a receive's step before this one kept. */
|
|
10
|
+
constructor(from) {
|
|
11
|
+
if (from === void 0) return;
|
|
12
|
+
this.#kept.push(...from.largest);
|
|
13
|
+
this.#partial = from.largestPartial === true;
|
|
14
|
+
this.#least = this.#kept.at(-1)?.size ?? 0;
|
|
15
|
+
}
|
|
16
|
+
add(oid, size) {
|
|
17
|
+
const kept = this.#kept;
|
|
18
|
+
if (kept.length === 64 && size <= this.#least) {
|
|
19
|
+
this.#partial = true;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
kept.push({
|
|
23
|
+
oid,
|
|
24
|
+
size
|
|
25
|
+
});
|
|
26
|
+
kept.sort((a, b) => b.size - a.size);
|
|
27
|
+
if (kept.length > 64) {
|
|
28
|
+
kept.pop();
|
|
29
|
+
this.#partial = true;
|
|
30
|
+
}
|
|
31
|
+
this.#least = kept.at(-1)?.size ?? 0;
|
|
32
|
+
}
|
|
33
|
+
/** The list, largest first, and `largestPartial` when it left a blob out. */
|
|
34
|
+
finish() {
|
|
35
|
+
const largest = [...this.#kept];
|
|
36
|
+
return this.#partial ? {
|
|
37
|
+
largest,
|
|
38
|
+
largestPartial: true
|
|
39
|
+
} : { largest };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** The largest of `objects`' blobs, as `LargestFiles` keeps them: a receive kept as rows. */
|
|
43
|
+
const largestOf = (objects) => {
|
|
44
|
+
const largest = new LargestFiles();
|
|
45
|
+
for (const object of objects) if (object.type === "blob") largest.add(object.oid, object.bytes.byteLength);
|
|
46
|
+
return largest.finish();
|
|
47
|
+
};
|
|
48
|
+
export { LargestFiles, largestOf };
|
|
@@ -209,9 +209,18 @@ var ReceivedPointers = class {
|
|
|
209
209
|
};
|
|
210
210
|
/** At a step's end, the pointers `found` as their table holds them, for the next step's `carried`. */
|
|
211
211
|
const pointersRecords = (found) => LfsPointers.pagesOf(found).map((page, at) => page.subarray(0, Math.min(pageEntries, found.count - at * pageEntries) * 57));
|
|
212
|
+
/**
|
|
213
|
+
* One page `pointersRecords` gave, read as pointers again, as import keeps them between its
|
|
214
|
+
* segments and its copy: `undefined` for bytes that aren't whole entries, or more than a page.
|
|
215
|
+
*/
|
|
216
|
+
const pointersOfRecord = (record) => {
|
|
217
|
+
const count = record.byteLength / 57;
|
|
218
|
+
if (!Number.isInteger(count) || count > 1024) return void 0;
|
|
219
|
+
return LfsPointers.made(count, [record]);
|
|
220
|
+
};
|
|
212
221
|
/** The pointers among a receive's whole objects, found by `pointers`. */
|
|
213
222
|
const pointersOfObjects = /* @__PURE__ */ Effect.fnUntraced(function* (objects, pointers = new ReceivedPointers()) {
|
|
214
223
|
for (const object of objects) if (object.type === "blob") yield* pointers.add(object.oid, object.bytes);
|
|
215
224
|
return pointers.finish();
|
|
216
225
|
});
|
|
217
|
-
export { ReceivedPointers, lfsOidAt, lfsPointers, lfsPointersMost, lfsSizeAt, noLfsPointers, pageEntries, pointerSizeMost, pointersOfBlob, pointersOfObjects, pointersRecords };
|
|
226
|
+
export { ReceivedPointers, lfsOidAt, lfsPointers, lfsPointersMost, lfsSizeAt, noLfsPointers, pageEntries, pointerSizeMost, pointersOfBlob, pointersOfObjects, pointersOfRecord, pointersRecords };
|
package/dist/storage/loose.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { copyRowsPage, eachHeldRow, gitObjectOf, heldRows, rowHeaders, rowSizes,
|
|
|
8
8
|
import { allotmentWithin } from "../contracts/object-values.mjs";
|
|
9
9
|
import { allottedRows } from "./allotted.mjs";
|
|
10
10
|
import { pointersOfObjects } from "./lfs-pointers.mjs";
|
|
11
|
+
import { largestOf } from "./largest-files.mjs";
|
|
11
12
|
import { wholeRoots } from "./roots.mjs";
|
|
12
13
|
import { commitBytes, unpackObjects } from "./unpack.mjs";
|
|
13
14
|
import { gitError } from "../contracts/result.mjs";
|
|
@@ -68,7 +69,8 @@ const receiveRows = /* @__PURE__ */ Effect.fnUntraced(function* (store, listed,
|
|
|
68
69
|
},
|
|
69
70
|
bytes: unpacked.bytes,
|
|
70
71
|
objects: unpacked.objects.length,
|
|
71
|
-
lfsPointers: yield* pointersOfObjects(unpacked.objects)
|
|
72
|
+
lfsPointers: yield* pointersOfObjects(unpacked.objects),
|
|
73
|
+
...largestOf(unpacked.objects)
|
|
72
74
|
};
|
|
73
75
|
if (unpacked.cut.length > 0) quarantine.cut = unpacked.cut;
|
|
74
76
|
received.add(quarantine);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { gitError } from "../contracts/result.mjs";
|
|
2
2
|
import { RequestHolding } from "../store/call-count.mjs";
|
|
3
|
-
import { pushFloorsOf, readerFloors, readerMost } from "./budget.mjs";
|
|
4
|
-
import { packIndexerLimits } from "./pack-reads.mjs";
|
|
3
|
+
import { pushFloorsOf, readerFloors, readerMost, receiveObjectsMostOf } from "./budget.mjs";
|
|
4
|
+
import { indexBytes, packIndexerLimits } from "./pack-reads.mjs";
|
|
5
5
|
import { ReceivedPointers, lfsPointersMost, pageEntries } from "./lfs-pointers.mjs";
|
|
6
6
|
import { receiveRoomAdmitted } from "./receive-admission.mjs";
|
|
7
7
|
import { ReceiveRoom } from "./runs.mjs";
|
|
@@ -948,7 +948,8 @@ const upkeepRuns = {
|
|
|
948
948
|
* The room a prune walk's reader holds its packs' `.idx` and `.rev` in, whatever their sum: a
|
|
949
949
|
* fixed size, never sized up to what's spare, which a walk charges once in place of each pack's
|
|
950
950
|
* (#2230). About 1,050,000 objects' indexes at 32 B an object. A merge cuts each pack it writes so
|
|
951
|
-
* its index fits,
|
|
951
|
+
* its index fits, a push takes no more objects than `pruneIndexObjectsMost`, and a walk refuses a
|
|
952
|
+
* listed pack whose index alone passes it.
|
|
952
953
|
*
|
|
953
954
|
* It fits beside the rest of a walk at its bounds: `pruneWalkHeld()`'s 47,844,271, this
|
|
954
955
|
* 33,554,432 and the read reserve's 4,194,688 come to 85,593,391, under the default memory's
|
|
@@ -956,6 +957,29 @@ const upkeepRuns = {
|
|
|
956
957
|
*/
|
|
957
958
|
const pruneIndexFloor = 33554432;
|
|
958
959
|
/**
|
|
960
|
+
* The most objects whose pack's index fits `pruneIndexFloor`, 1,048,528: 32 B an object past its
|
|
961
|
+
* fixed 1,508, in a pack under 2 GiB, whose index takes no large offsets (#2402). Every pack prune
|
|
962
|
+
* meets is: a received one's entries each start under `pushUploadMost` and take at most
|
|
963
|
+
* `packFileBytes`, and a merge cuts under `maxPackSizeMost`.
|
|
964
|
+
*/
|
|
965
|
+
const pruneIndexObjectsMost = Math.floor((pruneIndexFloor - indexBytes({
|
|
966
|
+
objects: 0,
|
|
967
|
+
bytes: 0
|
|
968
|
+
})) / (indexBytes({
|
|
969
|
+
objects: 1,
|
|
970
|
+
bytes: 0
|
|
971
|
+
}) - indexBytes({
|
|
972
|
+
objects: 0,
|
|
973
|
+
bytes: 0
|
|
974
|
+
})));
|
|
975
|
+
/**
|
|
976
|
+
* The most objects one push of `size`'s length takes in a `packs()` instance of `memory`: what its
|
|
977
|
+
* memory takes, `receiveObjectsMostOf`, and no more than `pruneIndexObjectsMost`, so a prune walk
|
|
978
|
+
* holds its pack's index, which no merge cuts while it's alone. Past it, a push is refused before
|
|
979
|
+
* it waits, by the most. In a Worker's 128 MB, 1,048,528, whatever its length.
|
|
980
|
+
*/
|
|
981
|
+
const pushObjectsMostOf = (memory, size = {}) => Math.min(receiveObjectsMostOf(memory, size), pruneIndexObjectsMost);
|
|
982
|
+
/**
|
|
959
983
|
* What a prune walk's seen set holds (#2019): a bit for each object of each of `packs`, at its rank,
|
|
960
984
|
* and for each of `outside` objects no listed pack holds, its ID, at `fetchEntryBytes`. A part's
|
|
961
985
|
* save puts the same bytes, the IDs at 20 each, so its read holds no more.
|
|
@@ -1099,4 +1123,4 @@ var AllottedPointers = class {
|
|
|
1099
1123
|
return this.#pointers.finish();
|
|
1100
1124
|
}
|
|
1101
1125
|
};
|
|
1102
|
-
export { AllottedPointers, MemoryAllotment, MemoryBudget, allottedWithin, fetchBusy, growWaitMs, headStuckMs, joinRoomOf, outsideOn, pruneIndexFloor, pruneSeenBytes, pushBusy, pushEntryTooLarge, pushIndexTooLarge, pushMemoryOf, pushTooLarge, pushWaitMs, readBusy, readerMemoryOf, upkeepMemoryOf, upkeepRuns, upkeepTooLarge };
|
|
1126
|
+
export { AllottedPointers, MemoryAllotment, MemoryBudget, allottedWithin, fetchBusy, growWaitMs, headStuckMs, joinRoomOf, outsideOn, pruneIndexFloor, pruneIndexObjectsMost, pruneSeenBytes, pushBusy, pushEntryTooLarge, pushIndexTooLarge, pushMemoryOf, pushObjectsMostOf, pushTooLarge, pushWaitMs, readBusy, readerMemoryOf, upkeepMemoryOf, upkeepRuns, upkeepTooLarge };
|
|
@@ -21,6 +21,7 @@ import { eachHeldRow, gitObjectOf, rowHeaders, rowSizes, rowsStartingWith, start
|
|
|
21
21
|
import { LeavingRow, decodeHeld } from "./rows.mjs";
|
|
22
22
|
import { SingleFlight } from "./single-flight.mjs";
|
|
23
23
|
import { allotted, keptOrLeft } from "./allotted.mjs";
|
|
24
|
+
import { fileBytesMost } from "./file-limits.mjs";
|
|
24
25
|
import * as Effect from "effect/Effect";
|
|
25
26
|
import * as Option from "effect/Option";
|
|
26
27
|
import * as Cause from "effect/Cause";
|
|
@@ -32,11 +33,6 @@ import * as Fiber from "effect/Fiber";
|
|
|
32
33
|
// src/storage/pack-reads.ts
|
|
33
34
|
/** The largest object `packs()` reads whole: a file past it is stored and sent as it is. */
|
|
34
35
|
const packObjectBytes = 16777216;
|
|
35
|
-
/**
|
|
36
|
-
* The largest file `packs()` takes, GitHub's limit: a blob sent whole, hashed as it streams and
|
|
37
|
-
* never held, and sent back as it is stored.
|
|
38
|
-
*/
|
|
39
|
-
const packFileBytes = 104857600;
|
|
40
36
|
/** How `packs()` resolves an entry, on a receive and on a read. */
|
|
41
37
|
const packIndexerLimits = {
|
|
42
38
|
objectBytes: packObjectBytes,
|
|
@@ -45,10 +41,14 @@ const packIndexerLimits = {
|
|
|
45
41
|
nameBytes: 4 * packObjectBytes,
|
|
46
42
|
chainReads: 64
|
|
47
43
|
};
|
|
48
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* How large an entry's header may say it is, for reads of headers alone: a file's to `fileBytesMost`,
|
|
46
|
+
* the most a push's `refuseAbove` may let in. A file past `packObjectBytes` is sent as it's stored,
|
|
47
|
+
* never read whole.
|
|
48
|
+
*/
|
|
49
49
|
const headerLimits = {
|
|
50
50
|
...packIndexerLimits,
|
|
51
|
-
objectBytes:
|
|
51
|
+
objectBytes: fileBytesMost
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
54
|
* What one operation's reads keep of the objects they resolve, across every pack it reads: a
|
|
@@ -1688,4 +1688,4 @@ const narrowedTo = (reads, visible) => {
|
|
|
1688
1688
|
wholeBlobs: (oids) => Effect.flatMap(only(oids), reads.wholeBlobs)
|
|
1689
1689
|
};
|
|
1690
1690
|
};
|
|
1691
|
-
export { IndexReloaded, IndexShort, PackBlocks, PackIndexes, blockBytes, blockHeld, blocksHeld, entryEnd, hashedNowMost, hashedRunMost, headerLimits, indexBytes, indexSeedShare, isIndexReloaded, isIndexShort, loadedLookup,
|
|
1691
|
+
export { IndexReloaded, IndexShort, PackBlocks, PackIndexes, blockBytes, blockHeld, blocksHeld, entryEnd, hashedNowMost, hashedRunMost, headerLimits, indexBytes, indexSeedShare, isIndexReloaded, isIndexShort, loadedLookup, packIndexerLimits, packObjectBytes, packObjects, packReader, rangedLookup, readCacheBytes, seedBytes };
|
|
@@ -18,6 +18,8 @@ import { packPutOptions, startPut } from "./merge.mjs";
|
|
|
18
18
|
import { repoTypes } from "./held-types.mjs";
|
|
19
19
|
import { checkedFilesRefused, checkedOverflow, checkedRecords, fsckRefusal, receiveChecked } from "./fsck.mjs";
|
|
20
20
|
import { packFiles } from "./layout.mjs";
|
|
21
|
+
import { fileBytesMost, fileRefuseBytes } from "./file-limits.mjs";
|
|
22
|
+
import { LargestFiles } from "./largest-files.mjs";
|
|
21
23
|
import { ReceivedPointers, pointersRecords } from "./lfs-pointers.mjs";
|
|
22
24
|
import { boundaryNotInPack, linkReader, segmentCut, segmentTooLarge, tagTargetMissing, wrongType } from "./links.mjs";
|
|
23
25
|
import { noRows } from "./object-rows.mjs";
|
|
@@ -30,7 +32,7 @@ import { checkRow, checkRowAt, sweepHeld, sweepRowAt, sweepRows } from "./receiv
|
|
|
30
32
|
import { pushPackTooLarge, pushUploadMost } from "./push-uploads.mjs";
|
|
31
33
|
import { chainUnitsOf, receiveTable, receiveTableBytes } from "./receive-table.mjs";
|
|
32
34
|
import { rootsCollected } from "./roots.mjs";
|
|
33
|
-
import {
|
|
35
|
+
import { packIndexerLimits, packObjectBytes, packReader } from "./pack-reads.mjs";
|
|
34
36
|
import { dropRefused, openQuarantine, stillOpen } from "./quarantine.mjs";
|
|
35
37
|
import { malformedPack, ofsRefused, readFailure } from "./unpack.mjs";
|
|
36
38
|
import { oidBytes } from "../protocol/packs/idx.mjs";
|
|
@@ -39,12 +41,47 @@ import * as Result from "effect/Result";
|
|
|
39
41
|
import * as Data from "effect/Data";
|
|
40
42
|
// src/storage/pack-receive.ts
|
|
41
43
|
/**
|
|
42
|
-
* How large the reader lets an entry be: a whole one to `
|
|
44
|
+
* How large the reader lets an entry be: a whole one to `fileBytesMost`, kept only if it's a blob,
|
|
45
|
+
* so a file past a push's `refuseAbove` is named, then refused by core with its path (#2395).
|
|
43
46
|
* Anything else, and any delta, is resolved whole, within `packObjectBytes`.
|
|
44
47
|
*/
|
|
45
48
|
const receiveLimits = {
|
|
46
49
|
...packIndexerLimits,
|
|
47
|
-
objectBytes:
|
|
50
|
+
objectBytes: fileBytesMost
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The steps of a staged receive that lists no largest files, an import's: a file past
|
|
54
|
+
* `fileRefuseBytes` is refused as it's read, by its offset alone. A push upload's steps list them,
|
|
55
|
+
* carried from step to step, and read an entry to what the try's CPU leaves past its share, as
|
|
56
|
+
* `StepInput.largest` says (#2468).
|
|
57
|
+
*/
|
|
58
|
+
const stepLimits = {
|
|
59
|
+
...packIndexerLimits,
|
|
60
|
+
objectBytes: fileRefuseBytes
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A push upload's step's limits, from the largest entry it reads, `entryMost`, as
|
|
64
|
+
* `StepInput.largest` says: the reader takes a whole entry to it, and each delta's instructions to
|
|
65
|
+
* `deltaBytes` or it if less; the indexer resolves and names a delta's result to the least of its
|
|
66
|
+
* own limits and it. So on a host whose try reads a smaller entry than `packObjectBytes`, no delta
|
|
67
|
+
* costs more than its largest entry (#2500). The indexer's `deltaBytes` stays
|
|
68
|
+
* `packIndexerLimits`': it bounds a chain's instructions together as it reads them again, each
|
|
69
|
+
* delta's already held to the reader's.
|
|
70
|
+
*/
|
|
71
|
+
const listingLimits = (entryMost) => {
|
|
72
|
+
const { objectBytes, deltaBytes, nameBytes } = packIndexerLimits;
|
|
73
|
+
return {
|
|
74
|
+
reader: {
|
|
75
|
+
...packIndexerLimits,
|
|
76
|
+
deltaBytes: Math.min(deltaBytes, entryMost),
|
|
77
|
+
objectBytes: entryMost
|
|
78
|
+
},
|
|
79
|
+
indexer: {
|
|
80
|
+
...packIndexerLimits,
|
|
81
|
+
objectBytes: Math.min(objectBytes, entryMost),
|
|
82
|
+
nameBytes: Math.min(nameBytes, entryMost)
|
|
83
|
+
}
|
|
84
|
+
};
|
|
48
85
|
};
|
|
49
86
|
/** What the reader may hold besides the entries it hands on: its inflater and buffers. */
|
|
50
87
|
const readerBytes = 1048576;
|
|
@@ -153,25 +190,28 @@ const tooDeep = (offset, links) => gitError("RESOURCE_EXHAUSTED", `The delta at
|
|
|
153
190
|
hint: deepHint,
|
|
154
191
|
context: { reason: "too-large" }
|
|
155
192
|
});
|
|
156
|
-
/** What a pusher does so Git sends each file past `packObjectBytes` whole, past its next gc too, or keeps it out of the pack with Git LFS. */
|
|
157
|
-
const wholeHint = "Set `git config core.bigFileThreshold 16m`, run `git repack -adf`, then push again, or track the file with Git LFS";
|
|
158
193
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
194
|
+
* What a pusher does so Git sends each file past `most` whole, past its next gc too, or keeps it
|
|
195
|
+
* out of the pack with Git LFS: `packObjectBytes`' 16m, or a smaller host's step's in KiB.
|
|
196
|
+
*/
|
|
197
|
+
const wholeHintOf = (most) => `Set \`git config core.bigFileThreshold ${most % 1048576 === 0 ? `${most / 1048576}m` : `${Math.floor(most / 1024)}k`}\`, run \`git repack -adf\`, then push again, or track the file with Git LFS`;
|
|
198
|
+
/**
|
|
199
|
+
* A delta whose base or result is past `most`, `packObjectBytes` or a push upload's step's largest
|
|
200
|
+
* entry: Git sends one for a file it holds as a delta, so its hint has Git hold files that size whole. Its reason is its own, not
|
|
161
201
|
* `object-too-large`: the same file sent whole is taken, so a pack that names its base outside it
|
|
162
202
|
* fails where one holding the file alone lands.
|
|
163
203
|
*/
|
|
164
|
-
const deltaTooLarge = (offset) => gitError("RESOURCE_EXHAUSTED", `The delta at ${offset} is of an object past the ${
|
|
165
|
-
hint:
|
|
204
|
+
const deltaTooLarge = (offset, most) => gitError("RESOURCE_EXHAUSTED", `The delta at ${offset} is of an object past the ${most.toLocaleString("en-US")} bytes this server resolves`, {
|
|
205
|
+
hint: wholeHintOf(most),
|
|
166
206
|
context: { reason: "delta-too-large" }
|
|
167
207
|
});
|
|
168
208
|
/** A whole object past `packObjectBytes` that isn't a file. */
|
|
169
209
|
const wholeTooLarge = (offset, kind) => gitError("RESOURCE_EXHAUSTED", `The ${kind} at ${offset} is past the ${packObjectBytes.toLocaleString("en-US")} bytes this server reads whole`, { context: { reason: "object-too-large" } });
|
|
170
210
|
/** A file past `packObjectBytes` that a tree names as its `.gitmodules` or `.gitattributes`. */
|
|
171
211
|
const checkedTooLarge = (offset) => gitError("RESOURCE_EXHAUSTED", `The .gitmodules or .gitattributes at ${offset} is past the ${packObjectBytes.toLocaleString("en-US")} bytes this server reads to check it`, { context: { reason: "object-too-large" } });
|
|
172
|
-
/** An entry the indexer found no place for, as the push's refusal. */
|
|
173
|
-
const unindexable = (offset, why) => {
|
|
174
|
-
if (why === "too big") return deltaTooLarge(offset);
|
|
212
|
+
/** An entry the indexer found no place for, as the push's refusal, `most` the largest it resolves. */
|
|
213
|
+
const unindexable = (offset, why, most = packObjectBytes) => {
|
|
214
|
+
if (why === "too big") return deltaTooLarge(offset, most);
|
|
175
215
|
if (why === "too deep") return gitError("RESOURCE_EXHAUSTED", `The delta at ${offset} is in too long a chain`, {
|
|
176
216
|
hint: deepHint,
|
|
177
217
|
context: { reason: "too-large" }
|
|
@@ -226,7 +266,8 @@ const startUpload = (bucket, key, input) => Effect.map(startPut(bucket, key, pac
|
|
|
226
266
|
*/
|
|
227
267
|
const receivePack = /* @__PURE__ */ Effect.fnUntraced(function* (input) {
|
|
228
268
|
const { store, bucket, listed, at, prune, receive } = input;
|
|
229
|
-
|
|
269
|
+
const most = input.objectsMost ?? receiveTableMost;
|
|
270
|
+
if (receive.objects > most) return yield* Effect.fail(tooMany(receive.objects, most));
|
|
230
271
|
const past = segmentTooLarge(receive);
|
|
231
272
|
if (past !== void 0) return yield* Effect.fail(past);
|
|
232
273
|
const opened = yield* openQuarantine({
|
|
@@ -393,6 +434,12 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
393
434
|
}, step && stepOf(step, carried?.state.links));
|
|
394
435
|
const checked = carried?.checked ?? receiveChecked();
|
|
395
436
|
const pointers = memory.pointers;
|
|
437
|
+
const listing = step === void 0 || step.largest !== void 0;
|
|
438
|
+
const largest = new LargestFiles(carried?.state.largest);
|
|
439
|
+
const limited = step?.largest === void 0 ? void 0 : listingLimits(step.largest.entryMost);
|
|
440
|
+
let inflated = 0;
|
|
441
|
+
const resolveMost = limited?.indexer.objectBytes ?? 16777216;
|
|
442
|
+
const refused = (offset, why) => unindexable(offset, why, resolveMost);
|
|
396
443
|
const indexer = new PackIndexer({
|
|
397
444
|
entryAt: (offset, before) => {
|
|
398
445
|
if (state.stored === void 0 || state.sweepAt !== void 0 && offset !== state.sweepAt) return deferring;
|
|
@@ -406,7 +453,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
406
453
|
},
|
|
407
454
|
allot: memory.outside,
|
|
408
455
|
held: (offset) => state.held?.get(offset)
|
|
409
|
-
}, packIndexerLimits, new IndexerCache(memory.cache));
|
|
456
|
+
}, limited?.indexer ?? packIndexerLimits, new IndexerCache(memory.cache));
|
|
410
457
|
const malformedDelta = (error) => malformedPack(error.message);
|
|
411
458
|
/**
|
|
412
459
|
* The pack's own object `oid`, as the table finds it by its hash: its slot, with a found row so
|
|
@@ -504,7 +551,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
504
551
|
});
|
|
505
552
|
return checkBytesFrom(oid, type, next, shallowCommit, boundaryCommit, graphed, 0);
|
|
506
553
|
};
|
|
507
|
-
const checkResolved = (oid, type, offset, resolved) => resolved.kind === "unindexable" ? Effect.fail(
|
|
554
|
+
const checkResolved = (oid, type, offset, resolved) => resolved.kind === "unindexable" ? Effect.fail(refused(offset, resolved.why)) : checkBytes(oid, type, resolved.object.bytes);
|
|
508
555
|
/** The object at `offset`, `oid` of `type`, checked as `checkBytes` says, or deferred for sweeps. */
|
|
509
556
|
const check = (oid, type, offset) => {
|
|
510
557
|
const resolved = indexer.resolve(offset);
|
|
@@ -514,13 +561,13 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
514
561
|
/** A check that waited for the sweeps: the object at `offset`, its ID hashed again from its bytes. */
|
|
515
562
|
const checkAt = Effect.fnUntraced(function* (offset, type) {
|
|
516
563
|
const resolved = yield* stepEffect(indexer.resolve(offset));
|
|
517
|
-
if (resolved.kind === "unindexable") return yield* Effect.fail(
|
|
564
|
+
if (resolved.kind === "unindexable") return yield* Effect.fail(refused(offset, resolved.why));
|
|
518
565
|
const { bytes } = resolved.object;
|
|
519
566
|
const checkedBytes = checkBytes(idOf(type, bytes), type, bytes);
|
|
520
567
|
if (checkedBytes !== void 0) yield* checkedBytes;
|
|
521
568
|
});
|
|
522
569
|
const readPointerResolved = (oid, offset, resolved) => {
|
|
523
|
-
if (resolved.kind === "unindexable") return Effect.fail(
|
|
570
|
+
if (resolved.kind === "unindexable") return Effect.fail(refused(offset, resolved.why));
|
|
524
571
|
if (lfsPointerOfBlob(resolved.object.bytes) === void 0) return void 0;
|
|
525
572
|
return pointers.add(oid, resolved.object.bytes);
|
|
526
573
|
};
|
|
@@ -554,7 +601,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
554
601
|
*/
|
|
555
602
|
const placed = (indexed, ended) => {
|
|
556
603
|
const whole = state.large.get(indexed.offset);
|
|
557
|
-
if (whole === void 0 || indexed.oid === void 0) return Effect.fail(
|
|
604
|
+
if (whole === void 0 || indexed.oid === void 0) return Effect.fail(refused(indexed.offset, indexed.why));
|
|
558
605
|
const { kind, size } = whole;
|
|
559
606
|
if (kind !== "blob") return Effect.fail(wholeTooLarge(indexed.offset, kind));
|
|
560
607
|
return {
|
|
@@ -577,7 +624,10 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
577
624
|
});
|
|
578
625
|
const slot = recorded.add(object.oid, object.offset, type);
|
|
579
626
|
if (chain !== void 0) recorded.setChain(slot, chain.links, chain.units, chain.base);
|
|
580
|
-
if (type === "blob")
|
|
627
|
+
if (type === "blob") {
|
|
628
|
+
largest.add(object.oid, indexed.size);
|
|
629
|
+
return ReceivedPointers.mayHold(indexed.size) ? readPointer(object.oid, object.offset) : void 0;
|
|
630
|
+
}
|
|
581
631
|
return check(object.oid, type, object.offset);
|
|
582
632
|
};
|
|
583
633
|
const settleObject = (recorded, indexed, chain, until) => {
|
|
@@ -598,6 +648,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
598
648
|
const indexed = given.kind === "unindexable" ? placed(given, ended) : given;
|
|
599
649
|
if (Effect.isEffect(indexed)) return indexed;
|
|
600
650
|
const { object } = indexed;
|
|
651
|
+
if (indexed.base !== void 0) inflated += indexed.size;
|
|
601
652
|
const base = indexed.base === void 0 || ended.base?.kind !== "oid" ? void 0 : {
|
|
602
653
|
oid: ended.base.oid,
|
|
603
654
|
offset: indexed.base
|
|
@@ -623,7 +674,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
623
674
|
const records = state.table;
|
|
624
675
|
const base = ended.base?.kind === "oid" ? ended.base.oid : void 0;
|
|
625
676
|
let slot = base === void 0 ? void 0 : recordOf(base);
|
|
626
|
-
if (records !== void 0 && base !== void 0 && slot === void 0) return records.awaited(base, ended.offset) ? void 0 : yield* Effect.fail(
|
|
677
|
+
if (records !== void 0 && base !== void 0 && slot === void 0) return records.awaited(base, ended.offset) ? void 0 : yield* Effect.fail(refused(ended.offset, "base not before"));
|
|
627
678
|
const sibling = slot !== void 0 && slot === state.walked;
|
|
628
679
|
state.walked = slot;
|
|
629
680
|
for (let link = 0, until = ended.offset; records !== void 0 && slot !== void 0; link += 1) {
|
|
@@ -652,7 +703,8 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
652
703
|
const sink = {
|
|
653
704
|
begin: (header) => {
|
|
654
705
|
state.count = header.count;
|
|
655
|
-
|
|
706
|
+
const most = input.objectsMost ?? receiveTableMost;
|
|
707
|
+
if (state.count > most) return Effect.fail(tooMany(state.count, most));
|
|
656
708
|
const sizing = room.take(receiveTableBytes(state.count)) ?? Effect.void;
|
|
657
709
|
return Effect.map(sizing, () => {
|
|
658
710
|
state.table = receiveTable(state.count);
|
|
@@ -672,9 +724,10 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
672
724
|
indexer.data(bytes);
|
|
673
725
|
},
|
|
674
726
|
entryEnd: (ended) => {
|
|
727
|
+
inflated += ended.size;
|
|
675
728
|
const done = entryEnded(ended);
|
|
676
729
|
if (step === void 0) return done;
|
|
677
|
-
const pauseAfter = () => ended.index + 1 < state.count && step.pause(ended.index + 1, ended.offset + ended.compressed) ? "pause" : void 0;
|
|
730
|
+
const pauseAfter = () => ended.index + 1 < state.count && step.pause(ended.index + 1, ended.offset + ended.compressed, inflated) ? "pause" : void 0;
|
|
678
731
|
return done === void 0 ? pauseAfter() : Effect.map(done, pauseAfter);
|
|
679
732
|
}
|
|
680
733
|
};
|
|
@@ -707,6 +760,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
707
760
|
linkedRows: [...state.linkedRows],
|
|
708
761
|
parents: [...state.parents],
|
|
709
762
|
large: [...state.large],
|
|
763
|
+
...step?.largest !== void 0 && { largest: largest.finish() },
|
|
710
764
|
...ended && { joining: {
|
|
711
765
|
leftOut: ended.leftOut,
|
|
712
766
|
otherRuns: ended.otherRuns
|
|
@@ -731,7 +785,8 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
731
785
|
const teed = { read: body.read.pipe(Effect.mapError(readFailure), Effect.tap((piece) => piece === void 0 || upload === void 0 ? Effect.void : upload.send(piece))) };
|
|
732
786
|
const hasher = step === void 0 ? nativeSha1Hasher() : stagedHash(step.staged.checksum);
|
|
733
787
|
const indexed = Effect.gen(function* () {
|
|
734
|
-
const
|
|
788
|
+
const limits = step === void 0 ? receiveLimits : limited?.reader ?? stepLimits;
|
|
789
|
+
const read = yield* readPackFrom(teed, hasher, sink, limits, meter, resume).pipe(Effect.mapError((error) => error instanceof DeltaError ? malformedDelta(error) : readFailure(error)), Effect.ensuring(body.cancel));
|
|
735
790
|
if (upload !== void 0 && !("paused" in read)) yield* upload.finish(read.bytes);
|
|
736
791
|
return read;
|
|
737
792
|
}).pipe(Effect.onError(() => upload?.abort ?? Effect.void));
|
|
@@ -749,7 +804,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
749
804
|
/** A deferred entry read again in a sweep: its header, its data, then its end as it streamed. */
|
|
750
805
|
const sweepEntry = Effect.fnUntraced(function* (row) {
|
|
751
806
|
const entry = yield* reader.blocks.entryAt(pack, row.offset, (each) => memory.outside(each.size));
|
|
752
|
-
if (entry === "too big") return yield* Effect.fail(
|
|
807
|
+
if (entry === "too big") return yield* Effect.fail(refused(row.offset, "too big"));
|
|
753
808
|
const ended = {
|
|
754
809
|
...entry.entry,
|
|
755
810
|
compressed: row.compressed,
|
|
@@ -873,7 +928,7 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
873
928
|
if (slot === void 0 || state.table === void 0) return void 0;
|
|
874
929
|
const offset = state.table.offsetAt(slot);
|
|
875
930
|
const resolved = yield* stepEffect(indexer.resolve(offset));
|
|
876
|
-
if (resolved.kind === "unindexable") return yield* Effect.fail(state.large.has(offset) ? checkedTooLarge(offset) :
|
|
931
|
+
if (resolved.kind === "unindexable") return yield* Effect.fail(state.large.has(offset) ? checkedTooLarge(offset) : refused(offset, resolved.why));
|
|
877
932
|
const { kind, bytes } = resolved.object;
|
|
878
933
|
if (idOf(kind, bytes) !== oid) return yield* Effect.fail(foundWrongly);
|
|
879
934
|
return {
|
|
@@ -1001,6 +1056,9 @@ const storePack = /* @__PURE__ */ Effect.fnUntraced(function* (input, opened, st
|
|
|
1001
1056
|
};
|
|
1002
1057
|
const rooted = roots?.roots();
|
|
1003
1058
|
if (rooted !== void 0) quarantine.roots = rooted;
|
|
1059
|
+
const kept = listing ? largest.finish() : void 0;
|
|
1060
|
+
if (kept?.largest !== void 0) quarantine.largest = kept.largest;
|
|
1061
|
+
if (kept?.largestPartial === true) quarantine.largestPartial = true;
|
|
1004
1062
|
if (leftOut.length > 0) quarantine.cut = leftOut;
|
|
1005
1063
|
if (named && state.linkedRows.size <= 64) quarantine.linked = {
|
|
1006
1064
|
packs: [...state.linkedPacks],
|