From 75a27ec1a4bc855c9481f208c5896a2957dddadc Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 18 Oct 2026 23:51:56 +0200 Subject: [PATCH] The have bucket takes a node's whole facts, as large as a chain value, never cut (issue 1162) A node's own key carries its profile and was refused at 4 KiB on novox and g14 (nats: message size exceeds maximum allowed). --- internal/broker/controller_buckets.go | 6 ++++-- internal/broker/have_bucket_test.go | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/broker/controller_buckets.go b/internal/broker/controller_buckets.go index 29ce9439..e08eba93 100644 --- a/internal/broker/controller_buckets.go +++ b/internal/broker/controller_buckets.go @@ -449,7 +449,9 @@ func EnsureLeaseBucket(ctx context.Context, js jetstream.JetStream) error { } // HaveBucketConfig is the options of the have bucket (novox/hq ADR 0429 §1): delivery.HaveHistory revisions of each -// key, no age, a value under a kilobyte (a have is JSON of about 500 bytes), 64 MiB on disk like the assignments. +// key, no age, 64 MiB on disk like the assignments. A module's have is JSON of about 500 bytes, but a node's own key +// carries its whole facts (its profile among them), several kilobytes on a desktop: a value is as large as the chain's +// buckets take, since a value is never cut (novox/hq ADR 0408 §6, issue 1162). func HaveBucketConfig() jetstream.KeyValueConfig { return jetstream.KeyValueConfig{ Bucket: delivery.HaveBucket, @@ -457,7 +459,7 @@ func HaveBucketConfig() jetstream.KeyValueConfig { "own facts) (novox/hq ADR 0429, design 47): written by each machine's node-engine under its own node's keys " + "alone, never by the controller; read by the delivery view and the watchman", History: delivery.HaveHistory, - MaxValueSize: 4 << 10, + MaxValueSize: ChainValueBytes, MaxBytes: 64 << 20, Storage: jetstream.FileStorage, } diff --git a/internal/broker/have_bucket_test.go b/internal/broker/have_bucket_test.go index cb584a68..076bf9f5 100644 --- a/internal/broker/have_bucket_test.go +++ b/internal/broker/have_bucket_test.go @@ -104,3 +104,12 @@ func TestAModuleReadingHaveAssignmentsAndBuildsReadsAndWritesNone(t *testing.T) } } } + +// A node's own key carries its whole facts (its profile among them), several kilobytes on a desktop: the have +// bucket takes any value the chain's buckets take, since a value is never cut (novox/hq ADR 0408 §6, issue 1162). +// 1162/AC1 +func TestTheHaveBucketTakesAValueAsLargeAsTheChains(t *testing.T) { + if got := HaveBucketConfig().MaxValueSize; got != ChainValueBytes { + t.Fatalf("the have bucket takes values up to %d bytes, the chain's up to %d", got, ChainValueBytes) + } +}