Repository navigation
fix(transact): a property keeps one vector length per graph - #2112
Conversation
`fluree_db_core::vector::check_vector` states which `f:embeddingVector` values the index can hold: 1 to 65,535 elements, each a finite f32, and the same length as the vectors the property already holds in that graph. The vector arena now applies it when it stores a vector, so the write paths can apply the same rule before they commit one. `BinaryIndexStore::vector_dims` reads a property's vector length from the arena manifest without loading a shard.
Every path that creates commits now checks its `f:embeddingVector` values against `check_vector` before the write, as it checks the datatype limit: - `build_commit` (transactions on every surface, merge, rebase, revert, graph sync) checks each vector against the length its property holds in that graph: the index's, else the first vector asserted since, else the first in the same commit. - Push checks each pushed commit the same way, against the ledger and the earlier commits of the push. - Bulk import stops with an error when its vector pool refuses a vector. - Flake generation refuses an empty vector, as before, and now also one longer than 65,535 elements or with a non-finite element. A refused write fails with `TransactError::InvalidVector` (HTTP 400) and commits nothing.
`it_vector_lengths` (grp_index): a property keeps the length of its first vector in novelty, in the index and in novelty over the index; one transaction holds one length per property; each named graph keeps its own; retracting the vectors keeps the length; 65,535 elements is the most. Covered on JSON-LD insert, upsert and update, SPARQL INSERT DATA and INSERT WHERE, Turtle insert and upsert, graph sync, merge, rebase, push and bulk import. Each ledger is indexed afterwards, by full rebuild and incrementally. `tests/fixtures/vector-lengths-4.2.3` is a ledger the v4.2.3 CLI wrote with two vector lengths on one property. The test pins that writes to it refuse any other length, and that its data moves to a new ledger by export and import once one length is kept.
A vector has 1 to 65,535 elements, and in each graph all the vectors of one property have the same length, retractions included. Embeddings of two lengths go on two properties or in two graphs.
Both branches register a test module in fluree-db-api/tests/grp_index.rs; both are kept.
A vector the index cannot store is a well-formed request whose value breaks a constraint the ledger holds, the class the datatype limit is in, so it now answers 422 rather than 400. The error type stays `err:db/InvalidTransaction`, the type a 422 already has when the committer flattens an error to its status, so the direct and replicated paths agree. Tests: the server maps the typed error and its flattened form to 422 with no `Retry-After`; every refusal in `it_vector_lengths` is 422.
`build_commit_failure` poisoned only a 400 or a 413 at once and staged anything else again, so a 422 (the datatype limit, or a vector the index cannot store) was staged three times, with back-off and a ledger refresh between attempts, before it failed with the same status. A 422 is a value that breaks a constraint the ledger holds; a lagging view can only miss such a constraint, never invent one, so the refusal stands after a refresh. It now poisons at once, like a 400. The test adds 422 to the statuses that poison, and both 422 refusals as `build_commit` returns them.
…nvalidVector` When a ledger has an index but this process has no binary store attached, the vector check cannot read the stored length, and it refuses the write rather than certify it. That refusal is about the process's state, not the request, so it is now a core error instead of `InvalidVector`. `InvalidVector` then means only a value that breaks the rule. A unit test covers the refusal, and that a ledger with no index takes the first vector.
The test of the v4.2.3 ledger that holds two vector lengths now covers what this change does with it: writes refuse any other length, and the data moves to a new ledger by export and import once one length is kept.
…the ledger's The vector check reads a property's stored length from the attached index store, and otherwise from novelty. If the store attached is older than the index the ledger's novelty starts from, a length indexed in between is in neither, and the check would take any length. It now refuses the write in that case, as it does when no store is attached at all. The test indexes a ledger twice, gives a second property its first length in the second index, then leaves the first index's store attached and expects a vector write on that property to be refused.
Conflicts in fluree-db-api/src/error.rs and fluree-db-server/src/error.rs: main's single status table (`ApiError::status_code`, `ApiError::error_type`) kept, and the server's own table dropped as main drops it. `InvalidVector` joins the datatype limit in the 422 arm and reads `err:db/InvalidTransaction` in the `@type` table, with a row in the every-variant test. The server test for a refused vector is kept.
…e-store test The test left the older store attached but cleared the range provider. With `shacl` enabled, staging reads the schema hierarchy through the provider, so the write was refused by "no range_provider attached" before the vector check ran, and the test failed under --all-features. It now attaches the older index's provider alongside its store, a consistent stale state that staging can read, so the refusal it expects comes from the vector check.
bplatz
left a comment
There was a problem hiding this comment.
Approving. Please review the inline feedback before merging. One general note: restore is also unchecked (the server's /import, Python's restore_ledger and the CLI's create --from), while the description lists only pull and clone.
| store: Option<&'s BinaryIndexStore>, | ||
| ) -> Result<Option<&'s BinaryIndexStore>> { | ||
| let refuse = |why: &str| { | ||
| Err(TransactError::Core(fluree_db_core::Error::other(format!( |
There was a problem hiding this comment.
This refusal is a TransactError::Core, which maps to 400 InvalidTransaction, and Raft's build_commit_failure poisons a 400 as BodyMalformed. A binary store that failed to load (ledger_manager logs "continuing without" and keeps index_t > 0) therefore turns every vector write into a permanent 400 with no retry. Since this is the process's state, not the request's, a typed variant mapped to 503 with Retry-After, treated as transient in Raft, seems right; the stale-store test could then assert the status.
There was a problem hiding this comment.
Agreed, and pulling on this went further than the status. On a ledger whose store failed to load, writes that read the index (an upsert, an update with a where) failed inside that read as a TransactError::Core, so a 400 that Raft poisons. Writes that read nothing from it committed without the checks that need the index, and that includes one that takes the ledger past its datatype limit, after which it can never be indexed. Nothing re-attempted the store load either: notify plans Noop, and a retrying client keeps the handle from going idle, so it stayed broken until a restart or a new index.
So it's two layers now:
- 2cc21c8 stops the ledger manager from caching a ledger without its store. The load fails with its own error, a 500. Requests within
store_load_retry(5 s) get that error without loading again, so a lasting failure is one load per window rather than one per request. The next request after the window loads again, and a reload that can't load the store keeps the ledger it had. - Your typed variant stays as the backstop, for a state whose attached store is older than the ledger's index or one a caller built without it. 20fccad adds
TransactError::IndexNotLoadedand one O(1)check_index_loadedthat each write lane calls before its first read; the vector check uses the same thing. It answers 503 +err:db/IndexNotLoaded+Retry-Afteron both the direct and committer paths: a newSubmissionError::IndexNotLoaded, settled so a keyed retry re-executes, and inRETRYABLE_503_TYPES.
On Raft both are transient. Worth knowing, though: a Raft client sees the 422 "submission poisoned" after three attempts either way, same as it did for the 400.
e65ed7e and 0cd67be cover a store that fails once and then heals, the retry window, the reload, and the datatype limit in every state.
| /// Refuse a commit on `base` that holds a vector the ledger cannot store. | ||
| /// | ||
| /// `graph_ids` maps each named graph `base` holds to its id; `iri` names a | ||
| /// property or graph in the refusal. Runs under the ledger's write lock |
There was a problem hiding this comment.
The non-handle commit() path holds no write lock. It's still race-free through verify_sequencing and the CAS publish, so the comment could say that instead.
There was a problem hiding this comment.
Good point, that comment was only right for the handle path. aef6920 rewords it: the handle path holds the write lock, and commit(), which holds none, lands only on the base it checked because of verify_sequencing plus the compare-and-set publish on that same head.
| return Err(VectorError::Empty); | ||
| } | ||
| let dims = match dims { | ||
| Some(expected) if usize::from(expected) != len => { |
There was a problem hiding this comment.
When the length is already known, a vector over 65,535 elements reports LengthMismatch ("expected 3, got 65536") rather than TooLong. Only push reaches this, since flake generation catches it first for local writes.
There was a problem hiding this comment.
Nice catch. 8ebc254 checks the u16 bound before comparing against the stored length, so a 65,536-element vector is TooLong whatever the property already holds, and the push test now asserts the exact refusal (… vector dims 65536 exceeds the maximum of 65535) with a length of 3 already set.
| let handle = self | ||
| .vector_pool | ||
| .insert_f64(self.g_id, p_id, v) | ||
| .map_err(|e| CommitCodecError::InvalidOp(format!("invalid vector: {e}")))?; |
There was a problem hiding this comment.
Import refuses with an untyped CommitCodecError string that doesn't name the property or graph. The docs say a write that breaks the rule is refused with Invalid vector (422), so either carry the type and IRI here or qualify the docs.
There was a problem hiding this comment.
I went with carrying the type rather than qualifying the docs. In a33eb40 the vector arena and the import's shared pool return VectorError, the spool refuses with the same InvalidVector a transaction gets (worded by one vector_dims::invalid_vector, so it names the property, and the graph when it's named), and ImportError::Invalid carries it out; the datatype limit rides the same route, since it had the same flattening. Tests cover Turtle, a TriG named graph and JSON-LD with exact messages. While in there I noticed the docs' "nothing in it is committed" isn't quite true for a large import, since import publishes a checkpoint every 50 chunks, so the docs now say what an import that stops keeps.
…nown `check_vector` compared a vector's length with the property's before checking that the length fits a `u16`, so a vector of 65,536 elements on a property of length 3 read "vector dims mismatch: expected 3, got 65536". No stored length can admit it, so it is now `TooLong` whatever the property holds. Only push reached this: flake generation refuses such a vector first on a local write. The push test now checks the exact refusal.
…checked against The comment on `vector_dims::check_commit` said it runs under the ledger's write lock. The handle path does; `commit()` holds none, and is race-free because it checks that the base is the published head (`verify_sequencing`) and publishes with a compare-and-set on that head.
… with a typed 503 A ledger whose binary store failed to load keeps its index `t` with no range provider, so every read of it fails. Writes failed inside their first read, with a core error that answered 400 `InvalidTransaction`, and the Raft commit worker poisons a 400 at once. The vector check refused the same state with a core error too. So a store that failed to load turned every write into a permanent 400. `TransactError::IndexNotLoaded` now names that state: the ledger has an index, but no range provider is attached, or the binary store attached is older than it. `check_index_loaded` decides it from the snapshot, in O(1), and every write lane calls it before its first read: `build_transact_policy_context` (the committers, push, Cypher, GraphQL), `stage_with_graph_delta` (before the graph-management dispatch), `stage_flakes`, `build_commit` (merge, rebase and revert reach it without staging), and `CurrentFacts`, which merge and rebase read first. The vector check's own refusal of an index it cannot read uses the same function and variant. It answers 503 with `err:db/IndexNotLoaded` and `Retry-After`, on the direct path and through the committer: `SubmissionError::IndexNotLoaded` carries it (settled, so a keyed retry re-executes) and the server reconstructs it; the code joins `RETRYABLE_503_TYPES`. The Raft commit worker treats it as transient, as it does any 503, and refreshes before retrying. Tests: the not-loaded and older-store states on every write lane through the API, the policy context and `CurrentFacts`; the status tables, the committer flattening, settlement, a keyed retry, and the Raft classification.
… its property and graph Bulk import refused a vector the ledger cannot store with an untyped string: the vector arena's error became a `CommitCodecError`, then "flake encode error: ...", then `ImportError::Transact(String)`, without the property or the graph. The datatype limit took the same route. The type now survives the whole way. The vector arena and the import's shared pool return `VectorError`; the spool refuses with the same `InvalidVector` a transaction gets, worded by the one `vector_dims::invalid_vector` (property, and graph when it is named), and the datatype limit stays `DatatypeLimitExceeded`. The sink's deferred error is a `TransactError` (`encode_failure` keeps the old text for real encode failures), the parse workers' channels carry `ImportError`, and `ImportError::Invalid` holds a refusal, displayed as the refusal itself. Python raises it as the transaction's refusal would be raised (`InvalidRequestError`, status 422); the CLI and the server's import job print it. The docs now say what an import does: it stops with the same error and, like an import that stops for any reason, keeps what it published at its last checkpoint. Tests: two lengths in Turtle, in a TriG named graph and in JSON-LD (the lane Cypher and CSV imports feed), and a vector too long, each with its exact refusal; a refused import leaves no commits.
Restore (the server's `/import`, Python's `restore_ledger`, the CLI's `create --from <file>.flpack`) does not check vector lengths, like pull and clone, and the module doc and the docs now say so and why. None of them creates a commit: they copy a ledger's existing commits, and its index, byte for byte, so the copy holds what its source holds and refuses what its source refuses. A ledger an earlier release left with two lengths still restores, which its move to one length by export and import needs when the source is gone. The new test restores the v4.2.3 two-length fixture from an archive and checks that the copy holds the source's vectors and refuses a further length.
Merge, rebase and revert reach build_commit without staging, so its own check is the one that refuses them; every lane the API test drives meets an earlier one.
# Conflicts: # fluree-db-api/src/error.rs # fluree-db-consensus/src/caching.rs
…tError The import's refusal reaches Python as the transaction's would: status 422, the message naming the property.
…atatype past the limit The not-loaded tests now load the ledger without its store (`LedgerState::load_with_store`), as `ledger_manager` holds it after a store fails to load: no range provider, no store, and dictionaries seeded from novelty alone. Stripping the store from a loaded ledger kept dictionaries seeded from the index, which hid the datatype case. In that state the datatypes the index holds cannot be counted, so a write adding one past the limit would commit and leave a ledger that can never be indexed. The new test checks it is refused and that the ledger still indexes.
…hout it When `load_and_attach_binary_store` failed, `get_or_load` logged "continuing without" and cached a `Ready` handle with no store at the index's `t`. Every range read of it fails, the checks that need the index cannot decide (a write could take the ledger past its datatype limit, and then it can never be indexed), each query loaded the store again on its own, and nothing loaded it again for the handle: no notify plans a change, and a retrying client keeps the entry from going idle. Only a restart, a new index, or an idle half hour healed it. Now the failure fails the load. The request gets the load's own error (a 500), and so do requests for `LedgerManagerConfig::store_load_retry` (default 5 s), without loading again: the `Failed` entry bounds a lasting failure to one load per window. The next request after it loads again. A reload that cannot load the store keeps the state and store the handle has, rather than swapping in one without a store. A ledger-state failure (not found, say) is not remembered; it fails as before.
…very state A store fails to load here because its cache directory is a file, which fails every load the same way and is put right by making it a directory. - The next request after a failed load loads again: no handle without the store is served meanwhile, and the ledger heals with no restart. - Within `store_load_retry` every request gets the remembered failure without loading again, even once the store could load; the first after the window loads. - Reads a ledger cached without its store still answered (a query, a commit's detail, a query at an earlier `t`) get the load's error. - A datatype past the limit is refused with the store (422), through the ledger manager when the store fails to load (the load's error) and on a state built without the store (503); nothing commits and the ledger still indexes. It replaces the test of the last state alone.
# Conflicts: # fluree-db-api/src/commit_transfer.rs
…it reads it `main` added two readers (`named_by`, `all_named_by`) that read the index without the check `of_slots` and `of_subject` made. The check now runs in `base`, the one place every reader that reads the index reads it, so a reader added later cannot skip it; `whole_graph`, which reads through its own scan, keeps its own. The unit test covers the two new readers.
# Conflicts: # fluree-db-api/src/commit_transfer.rs # fluree-db-api/src/error.rs
|
Thanks for merging main in. Heads up: I have your review items (the 503 for an index this process hasn't loaded, the commit-path comment, the |
…tor-lengths # Conflicts: # fluree-db-api/src/error.rs
|
Agreed the description was incomplete there. I looked at enforcing it on restore, but restore, like pull and clone, creates no commits: it copies the archive's commits and index byte for byte. So I think the right call is the exemption, stated precisely: the copy holds what its source holds and refuses what its source refuses, and refusing the restore would leave a ledger an earlier release wrote with two lengths unrestorable, which is exactly when the export → import move needs a loadable copy. 6af5b31 says that in the module doc and the docs and adds a test that restores the v4.2.3 two-length fixture from an archive and checks the copy refuses a further length. The description now lists every path that brings data in and which of them check. If you'd rather restore refuse outright, happy to talk it through. |
Summary
The index stores each property's
f:embeddingVectorvalues in each graph at one length, and a vector has at most 65,535 elements. Writes now apply that rule before they commit: a vector whose length differs from the vectors its property already holds in that graph, or with more than 65,535 elements, is refused withInvalid vector(HTTP 422), and nothing in the write is committed. One function states the rule, and the index applies that same function when it stores a vector, so the two can't drift apart.A ledger whose binary index store fails to load is no longer cached without it. The load fails with its own error (HTTP 500), requests within a short window get that error without loading again, and the next request after the window loads again, so the ledger heals once its store can load, with no restart. A write on a state that still lacks the index this process needs (one whose attached index is older than the ledger's, or one a caller built without the store) is refused before its first read with
err:db/IndexNotLoaded(HTTP 503,Retry-After).What changes
fluree_db_core::vector::check_vectordecides whether a vector can be stored: 1 to 65,535 elements, each a finite f32, and the length the property already has in that graph. The first vector a property receives in a graph sets the length; retracting vectors does not reset it, since the index keeps history. A vector over 65,535 elements isTooLongwhatever length the property holds. The vector arena applies this function when it stores a vector.build_commit: transactions on every surface (JSON-LD insert, upsert and update; SPARQL UPDATE; Turtle and TriG), graph sync, merge, rebase and revert. Each vector is checked against the length in the index (read from the arena manifest, no shard loaded), else the first vector asserted since the index, else the first earlier in the same commit. A commit lands only on the base it was checked against: the handle path holds the write lock, andcommit()checks that the base is the published head (verify_sequencing) and publishes with a compare-and-set on that head.fluree create --from, the server's import upload; the Cypher and CSV imports feed it as JSON-LD): the import's vector pool applies the rule as it reads, and the import stops with the sameInvalid vectorrefusal a transaction gets, naming the property and graph. Like an import that stops for any reason, it keeps what it published at its last checkpoint (one every 50 chunks by default)..flpackarchive (the server's/import, Python'srestore_ledger, the CLI'screate --from <file>.flpack) create no commits: they copy a ledger's existing commits, and its index, byte for byte. The copy holds what its source holds and refuses what its source refuses, and a ledger an earlier release left with two lengths still restores, which its move to one length by export and import needs when the source is gone. A ref moved through the nameservice sync endpoints points at commits a writer with access to the ledger's storage built through its own commit path; the server reads none of them. Raft followers apply what the leader built.ledger_managerlogged "continuing without"), and nothing loaded the store again: no nameservice notification plans a change, and a retrying client keeps the entry from going idle, so only a restart, a new index, or half an hour without access healed it. Now there are two layers.get_or_loadfails with the load's own error. ForLedgerManagerConfig::store_load_retry(default 5 s) requests get that error without loading again, so a lasting failure costs one load per window rather than one per request (concurrent requests already share one load). The first request after the window loads again. A reload that can't load the store keeps the state and store the ledger has, rather than swapping in one without a store. A ledger-state failure (not found, say) isn't remembered and fails as before.check_index_loadedstays as the backstop.TransactError::IndexNotLoaded: the ledger has an index, but no range provider is attached, or the binary store attached is older than it. That covers a state a caller built without the store and an install that left an older store attached.check_index_loadeddecides it from the snapshot in O(1), and each write lane calls it before its first read:build_transact_policy_context(the committers, push, Cypher, GraphQL),stage_with_graph_delta,stage_flakes,build_commit, andCurrentFacts. The vector check's refusal of an index it can't read lengths from is the same variant.TransactError::InvalidVector, answered with 422 /err:db/InvalidTransaction: a well-formed request whose value breaks a constraint the ledger holds, the class the datatype limit's 422 is in. A 422 already carries that type when the committer flattens an error to its status, so the direct and replicated paths agree, and the Raft commit worker now poisons a 422 at once, as it does a 400, instead of staging it again (this also applies to the datatype limit). NoRetry-After. The message names the property, and the graph when it is a named graph:Invalid vector: <http://example.org/embedding> in graph <http://example.org/g1>: vector dims mismatch: expected 3, got 2.err:system/InternalError, for examplefailed to load binary index: .... Through the committer it's anExecution { status: 500 }, which is settled, so a keyed retry re-executes; the Raft commit worker treats a failed load as transient.TransactError::IndexNotLoaded, answered with 503 /err:db/IndexNotLoadedandRetry-After, on the direct path and through the committer (SubmissionError::IndexNotLoaded, settled, so a keyed retry re-executes). It joinsRETRYABLE_503_TYPES. The Raft commit worker treats it as transient, as any 503, and refreshes before retrying. A Raft client sees a 422 "submission poisoned" after its retries, as it did for the 400 this replaces.ImportError::Invalidholds theInvalidVector(orDatatypeLimitExceeded) a transaction gets. Python raises it asInvalidRequestErrorwith status 422.Behavior changes
store_load_retry(5 s) get it without loading again; the next request after loads again and the ledger heals; a reload that can't load the store keeps the ledger it haswhere) failed inside that read with 400err:db/InvalidTransaction, which the Raft commit worker poisons at once; one that reads nothing from it (an insert with no SHACL config) committed without the checks that need the indexdatatype dict overflow (dt_id=16384 exceeds the maximum of 16383)err:db/IndexNotLoadedon a state built without the store; the ledger still indexestansweredledger-existsand the default context still answer; ledger info and export failed before tooerr:db/IndexNotLoadedvector dims mismatch: expected 3, got 65536vector dims 65536 exceeds the maximum of 65535transact: flake encode error: ..., naming neither property nor graphImportError::Invalid:Invalid vector: <property> [in graph <graph>]: ..., or the datatype-limit refusal; Python raisesInvalidRequestError(422) instead ofFlureeErrorCompatibility
u16. Existing ledgers load and index as before.tests/fixtures/vector-lengths-4.2.3, a ledger the v4.2.3 CLI wrote (the same fixture fix(index): every xsd:double value is indexable #2044 uses), pins that path, and the same ledger restored from an archive behaves as its source.LedgerManagerConfiggainsstore_load_retry(a struct literal with..Default::default()is unaffected);TransactErrorgainsInvalidVectorandIndexNotLoaded;SubmissionErrorgainsIndexNotLoaded;ImportErrorgainsInvalid;fluree_db_transact::check_index_loadedis new;BinaryIndexStoregainsvector_dims;fluree_db_core::vectoris new;VectorArena::insert_f32/insert_f64andSharedVectorArenaPool::insert_f32/insert_f64returnVectorErrorinstead ofString. The vector arena's error strings are unchanged except the too-long one, which now readsvector dims N exceeds the maximum of 65535, and the arena checks a vector's length before its elements.SubmissionErrorwithout a wildcard, so it needs an arm forIndexNotLoaded(transient), as it does for fix: JSON-LD graph scoping, config integrity and explicit-only SHACL #2009'sConfigUnavailable;TransactError::IndexNotLoadedin its transient arm, since an unlistedTransact(_)is deterministic there.InvalidVectorandImportError::Invalidneed nothing.Performance
Non-vector writes pay one pass over the commit's flakes to find vectors, beside the existing size pass. Vector writes add, per distinct property and graph, one length lookup that is in memory by construction: the arena manifest, which the store loads with the index, or else one seek in novelty. There's also one pass over each vector's elements; no I/O is added. Measured against
mainat745736a04, before this branch was rebased onto currentmain, both CLIs built with thedev-fastprofile, one process per insert into a new ledger, runs interleaved, medians:mainA first 12-run pass read 0.99 and 1.02 for the two non-vector rows, so both were re-measured at 20 runs (above).
Steady state, counted in instructions retired per commit (
dev-fast, in-memory ledger, no background indexer, againstmainatba694ee79, 3 interleaved runs of 200 commits, medians). The ledger holds 20,000 indexed vectors of 128 elements on one property and 2,000 more in novelty:mainWhat the vector commit pays for is the checks on its five vectors (their elements are read twice, once when the flake is generated and once at commit) and one length lookup in the index.
The later changes on the write path:
check_index_loadedis O(1): atcomparison, anOptioncheck, a type comparison and the store'smax_t. A write runs it a few times.Counted in instructions retired (
dev-fast, in-memory ledger without background indexing, holding 20,000 indexed vectors of 128 elements and 2,000 more in novelty; 5 interleaved runs, medians):For commits, "without" is this branch with
check_index_loadedmade a no-op; for the import, it's the commits before and after the typed import (20fccad5f,a33eb40af). Runs varied by about ±1.5% from round to round, so the commit rows show no measurable change.Tests
it_vector_lengths(grp_index), where every refusal is checked to beInvalidVectorwith status 422:it_store_load_failure(grp_index); a store fails to load there because its cache directory is a file:store_load_retryevery request gets the remembered failure without loading again, even once the store could load, and the first after the window loads;tget the load's error;it_vector_lengths, a state built without the store (LedgerState::load_with_store: no range provider, no store, dictionaries seeded from novelty alone): insert, upsert, update and a vector insert, and the policy context the committers build first, are each refused withIndexNotLoadedand status 503, and nothing commits; with an older store attached, a write with and without vectors is refused the same way.IndexNotLoadedas transient; the committer flattensIndexNotLoadedto its ownSubmissionError, which is settled, and a keyed retry after it re-executes.err:db/InvalidTransactionand noRetry-After;IndexNotLoadedin both forms answers 503 witherr:db/IndexNotLoadedandRetry-After, in the 503 allowlist and the exhaustiveSubmissionErrorclassification.InvalidRequestErrorwith status 422, naming the property.fluree_db_core::vector, including a vector too long when the length is known), the refusal when the index isn't loaded (vector_dims,CurrentFacts,build_commiton a view built without staging), flake generation's refusal of a vector longer than 65,535 elements, the novelty lookup of a property's first vector (other values of the property, retractions, neighbouring properties, another graph), and the import spool's typed datatype-limit refusal.Commits
feat(core): one rule for the vectors a ledger can store.fix(transact): refuse a vector the ledger cannot store.test(api): vector lengths on every write path.docs: the length of a vector.main(fix(index): every xsd:double value is indexable #2044 and fix(server): query routes read a request's dataset the way the engine does #2019): both register a test module ingrp_index.rs; the shared fixture is the same bytes.fix(api): refuse an unstorable vector with 422.fix(consensus): the Raft commit worker poisons a 422 refusal at once.fix(transact): a vector check that cannot read the index is not anInvalidVector.test(api): the two-length fixture test pins the migration only.fix(transact): refuse a vector when the attached index is older than the ledger's.main(07b424738,ac59bd9ed); no conflicts.8ebc25448fix(core): a vector too long to store isTooLongwhen its length is known.aef692057docs(transact): how a commit lands only on the base its vectors were checked against.20fccad5ffix(transact): refuse a write on an index this process has not loaded with a typed 503.a33eb40affix(import): an import refuses a vector as a transaction does, naming its property and graph.6af5b318edocs: pull, clone and restore copy a ledger as it is.f00eb71dftest(transact):build_commitrefuses a base whose index is not loaded.590defe61Merge ofmain(fix: JSON-LD graph scoping, config integrity and explicit-only SHACL #2009):ApiError::status_code/error_typeand the submission weigher keep bothConfigUnavailable(500,err:storage/ReadFailure) andIndexNotLoaded(503). On a ledger whose index is not loaded,IndexNotLoadedis decided first, before the config read.9d33c0f1ctest(python): a bulk import refused for a vector raisesInvalidRequestError.22b02c648test(api): the not-loaded state as a failed store load leaves it; a datatype past the limit.2cc21c89bfix(api): a ledger whose binary store fails to load is not cached without it.e65ed7e46test(api): a store that fails to load; a datatype past the limit in every state.0cd67be0atest(api): a reload that cannot load the store keeps the ledger it has.46c9218bbMerge ofmain(perf(binary-index): resolve a persisted subject's Sid without a reverse lookup #2119); no conflicts.97e039302style(api):parse_ttl_chunkreturns its parse directly.099459cb7Merge ofmain(fix(indexer): a fact deleted before an incremental build stays deleted in a graph new to the index #2118, fix(transact): write fidelity, part 2 — one fact identity, microsecond temporals, value reads #2109): inpush_commitsthe push's vector check stays ahead of the retraction check, which now reads through the evolving state.e2cc61a22fix(transact):CurrentFactsrefuses an index it has not loaded where it reads it, so the two readersmainadded (named_by,all_named_by) are covered too.