Repository navigation
Commit CRDT writes, coerce VECTOR literals, restore cluster tests - #413
Merged
Merged
Conversation
An array literal bound for a column declared VECTOR(dim) becomes an array of floats on every write path and every engine, including schemaless and columnar-family collections that advertise the column as text. The declared type text is now kept on every raw DDL column so the rule applies there. A non-numeric element is refused with SQLSTATE 42804 naming the column.
Narrow the CI nextest exclusion to the one cluster test that still fails there and document its cause.
A CRDT error now takes the Data-Plane error code of its cause instead of reading as a server fault. The SQLSTATE, public error class, and cluster wire form follow that code, and only a Loro fault stays internal. Add UndefinedObject and ObjectNotInPrerequisiteState to the exhaustive error-code matches.
rustls before 0.23.45 accepts TLS 1.3 handshake messages across encryption level boundaries (GHSA-2mjx-qc3c-rqvc). Update the fuzz lockfile to the patched release, along with rustls-webpki and the other transitive updates the resolver pulled in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CRDT writes now commit every Loro operation and return typed client errors.
VECTOR(dim)columns coerce array literals to floats, and three cluster tests return to the CI profile.What changed
DocumentCell::mutate, which runs one local write and commits the Loro transaction, on success and on error. Route everyCrdtStatemutation through it.nodedb-crdt/src/state/document_cell.rs,nodedb-crdt/src/state/core.rs,nodedb-crdt/src/list_ops.rs,nodedb-crdt/src/state/RowAbsentAtVersion,BlockListRowAbsent,BlockListPathUnresolved,BlockListNotMovable, andBlockListIndexOutOfBoundstoCrdtError. Replace theCrdtError::LoroandDeltaApplyFailedstrings inTenantCrdtEnginewith typed variants.nodedb-crdt/src/error.rs,nodedb/src/engine/crdt/tenant_state/CrdtErrorto anErrorCodeclass in an exhaustiveFrom<&CrdtError>. AddErrorCode::UndefinedObject(42704) andErrorCode::ObjectNotInPrerequisiteState(55000), and mirror both inDataPlaneErrorCode.nodedb/src/bridge/envelope/,nodedb-cluster/src/rpc_codec/data_plane_error.rs,nodedb/src/control/cluster/data_plane_error_wire.rs,nodedb/src/control/server/shared/ddl/sqlstate.rs,nodedb/src/error_classify/VECTOR(dim)column to floats on theVALUES,SET, andDEFAULTpaths. Refuse a non-numeric element withSqlError::VectorElementNotNumeric(42804).nodedb-sql/src/planner/declared_vector_coerce.rs,nodedb-sql/src/planner/declared_type_coerce.rs,nodedb-sql/src/error.rsColumnInfo::raw_typeindeclared_column_info, so schemaless and columnar-family columns keep theirVECTOR(dim)declaration.nodedb/src/control/planner/catalog_adapter/type_convert.rs,nodedb-sql/src/types/collection.rsscheduler.rsintoScheduler::runinrun_loop.rs.nodedb/src/control/cluster/calvin/scheduler/driver/core/default-filter:ollp_implicit_edge_delete_cleans_reverse_cross_node,ollp_implicit_edge_update_moves_edge_cross_node,native_implicit_edge_delete_cleans_reverse_cross_node.learner_caught_up_via_real_install_snapshotstays excluded..config/nextest.tomlrustlsto 0.23.45 (andrustls-webpkito 0.103.15) in the fuzz lockfile. The workspace lockfile already has 0.23.45.fuzz/Cargo.lockSERIALin the column list, array literals toVECTORcolumns, andRESTORE ... SET VERSIONon a CRDT collection in a non-default database.nodedb/tests/wire/cases/sql_serial_column_list.rs,nodedb/tests/wire/cases/sql_vector_array_literal.rs,nodedb/tests/wire/cases/crdt_restore_non_default_database.rsWhy
XX000).XX000.crate::Error::Crdtmapped to a generic internal code, and several errors were plain strings.VECTORarray literal reached the engine untyped.VECTOR(dim)through unchanged.rustls0.23.42 infuzz/Cargo.lock(GHSA-2mjx-qc3c-rqvc, moderate).rustlsbefore 0.23.45 accepts TLS 1.3 handshake messages across encryption level boundaries.VECTOR(dim)declaration on a schemaless or columnar-family column was lost.declared_column_infoleftraw_typeasNone.main. Each test passed 6/6 onubuntu-24.04-armandubuntu-24.04with no retries.Linked issues
sql_vector_array_literal.rssql_serial_column_list.rs: the behaviour already holds onmain, and this PR adds the regression testscrdt_restore_non_default_database.rsCloses #306
Closes #319
Closes #353
Closes #379
Known limits
learner_caught_up_via_real_install_snapshotstays excluded from the CI profile. The Calvin sequencer stalls after log compaction because of the sequencer epoch seed. That work is open and outside this PR.CrdtStatemutation commits the operations it authored before the error. A caller that needs all-or-nothing captures aRowImageand callsrestore_row_imageon error.How to check it
cargo nextest run --workspace --exclude nodedb-cluster-tests --all-features --no-fail-fast --retries 0cargo nextest run -p nodedb-cluster-tests --all-features --no-fail-fast --retries 0cargo clippy --workspace --all-targets --all-features -- -D warnings.github/workflows/static-gates.ymlcargo check --locked --binsinfuzz/