Split compositions from the inline body so their large files' objects are put, and refuse a composition naming an object the bucket lacks (issue 1945)

This commit is contained in:
2026-10-25 01:42:28 +02:00
parent b1f758ed71
commit 82c89bec65
3 changed files with 106 additions and 1 deletions
+11 -1
View File
@@ -83,7 +83,7 @@ func composeModules(ctx context.Context, open *stores, nodes []string) (map[stri
errs = append(errs, fmt.Errorf("%s: %w", node, err))
continue
}
body, err := declared.Body()
body, err := compositionBody(declared)
if err != nil {
errs = append(errs, fmt.Errorf("%s: %w", node, err))
continue
@@ -360,3 +360,13 @@ func sliceOfModule(resources []json.RawMessage, module string) []json.RawMessage
}
return out
}
// compositionBody is the body a node's compositions are split from: every file's content inline, never by digest, so
// writeComposed puts each object of a file over 64 KiB in the node's bucket before it writes the composition that names
// it (ADR 0539 §4). A send's body names those files by digest for a node that reads references, and a send put their
// objects itself; with sends gone, a composition split from that body named objects nothing put (issue 1945, live on
// 2026-10-25: novox's nats.bus-users).
func compositionBody(declared sendable) ([]byte, error) {
declared.fileReferences = false
return declared.Body()
}