Tags: codenotary/immudb
Tags
docs(scan): clarify that ScanRequest.sinceTx=0 waits for latest commi… …tted tx Closes #2082. The server already delivers the behavior requested in #2082: when a client calls Scan with sinceTx=0 (the default), pkg/database/database.go's snapshotSince captures d.st.CommittedAlh() at call-reception time and then calls SnapshotMustIncludeTxID, which blocks on indexer.WaitForIndexingUpto before returning the snapshot. That means the scan observes every write committed before the call arrived, with no need for the caller to learn the latest tx id out of band — useful when multiple client processes write concurrently. This was invisible from the API docs: the protobuf comment only described the sinceTx>0 case, and the deprecated noWait field wasn't marked as unhonored by Scan, inviting users to think it was a "get a fresher read" toggle when in fact the server already waits unconditionally. Changes: - pkg/api/schema/schema.proto: spell out both branches of sinceTx, reference #2082, and note that noWait is deprecated AND ignored by Scan. - pkg/api/schema/schema.pb.go, docs.md, schema.swagger.json: mirror the comment change in the generated artifacts by hand. A full 'make build/codegen' regen was not run here because the locally installed protoc-gen-go (v1.36) differs from the version used to check in the current schema.pb.go (v1.32) and would produce large unrelated churn. - pkg/database/scan_latest_test.go: new test that guards the contract — a Set immediately followed by Scan(sinceTx=0) must see the just-written key, exercised in a 50-iteration loop to catch indexing races.
PreviousNext