Repository navigation
A release for label-wide writes and schema changes: bulk statements that
finish under concurrent writes, property renames, required properties with
defaults, and distinct counts.
Changed
- Breaking: the command format is version 3. 3.0.17 writes every commit
in command format 3 (it adds the commands of the label schema changes
below). Logs in formats 1 and 2 are still read, so a store written by any
3.x release starts on 3.0.17. A WAL written by 3.0.17, and a base backup
taken by it, are refused by 3.0.16: take a base backup before upgrading if
you may need to roll back, and roll back by restoring it with 3.0.16.
Followers must run 3.0.17 before their leader does. - Breaking: a DML statement is no longer bounded by the response size
limit. AnUPDATE,DELETEorINSERTwithoutRETURNINGanswers with
its count only, on every route (HTTP, gRPC, the PostgreSQL wire, Cypher and
GQLSET, MongoDBupdateMany). SQL charged the writes a statement plans
to the request's response budget (the body limit, 16 MiB by default), so
anUPDATEof every record of a label of about a million records failed
withresponse would exceed the response size limitalthough it returns
one row. The planned writes are now charged toquery-memory-max(the
statement's working set,query working set exceeded), and a graph
language mutation stages up to its own 64 MiB whatever the body limit. The
Rust APIexecute_sql_mutation_in_view_with_budgetis now
execute_sql_mutation_in_view, without the budget. - A long statement finishes while small writes keep committing. A SQL
or MongoDB statement outside a transaction that loses its commit to a
concurrent write to what it read is run once more by the server, at a
fresh snapshot with the tenant's other commits waiting until it commits
(other tenants keep committing). AnupdateManyor label-wideUPDATE
under a steady trickle of single-record writes to the same label used to
fail withwrite_conflicton every attempt, however often the client
retried. The first attempt stays optimistic, so uncontended statements
never make other writers wait, and the statement is still applied whole,
at one snapshot, or not at all. A statement inside a transaction keeps
first-committer-wins. While the re-run holds the tenant, another write to
it waits at mostheld-commits-wait-ms(new; default 10,000 ms,0= no
limit;--held-commits-wait-ms,RUSHDB_HELD_COMMITS_WAIT_MS,
resources.held-commits-wait-ms) and then fails with a retryable
resource_exhausted, nothing written; the re-run itself is not cut short.
Transaction commits now wait for a held tenant too. - A MongoDB
updateManyconflicts only with writes to what it read: the
records it matched and the label and index ranges its filter scanned, as
SQL DML does since 3.0.16. It used to be refused by any write to the
tenant. linkRecordsPairsresolves each endpoint once. The endpoints it
resolves and checks before the commit are staged as they are; the commit
only checks that each endpoint's record header still exists (once per
record and batch), instead of resolving every id again under the tenant's
lock. A pair whose endpoint was deleted, or deleted and created again
under its id, after it was resolved fails the call, as before.- A MongoDB update or delete applies to every record it matches. It used
to apply to the first 1,000,000 only, silently. Its matching is bounded by
query-memory-maxlike any read (resource_exhaustedpast it).
Added
- Rename a property of one label, in one commit: SQL
ALTER TABLE "L" RENAME COLUMN a TO band the nativemutate.renameProperty(label,
from,to). Each value keeps its type, the label's ordered, unique and
full-text indexes on the property answer for the new name from the same
commit without a rebuild, and a required rule moves with it. Other labels
keep the old name. A MongoDB$renameinupdateManyrenames per matched
document. - Remove a property from one label:
mutate.deletePropertytakes an
optionallabel, and SQLALTER TABLE "L" DROP COLUMN [IF EXISTS] adoes
the same. Withoutlabel,deletePropertystays tenant-wide. - Required properties with defaults: SQL
ALTER TABLE "L" ADD COLUMN x <type> NOT NULL [DEFAULT v],ALTER COLUMN x SET NOT NULL,SET DEFAULT,
DROP DEFAULTandDROP NOT NULL, and the native
mutate.requireProperty(label,property, optionaldefault) and
mutate.dropRequiredProperty. Declaring one gives the default to every
existing record without a value, in the same commit (without a default,
it is refused while a record lacks a value). Afterwards a record created
without the property gets the default on every write path, and a write
that leaves a record of the label without a non-null value is refused with
conflict(required property conflict), checked in the commit like a
unique index. - Distinct counts in the native query:
{"$count": "$record.city", "$distinct": true}counts each value once (nulls not at all), and
{"$count": "$alias", "$distinct": true}each related record once per
group, server-side and charged toquery-memory-max. Without a filter
orgroupByon one label, a property's distinct count is read from the
value dictionary, without reading a record. SQLCOUNT(DISTINCT x)
already ran on the server.
Fixed
- SQL
UPDATEwrites values a mixed-type column shows as text. A
column holding values of more than one type reads as text, so a stored
integer looked equal to the textCAST(x AS VARCHAR)made of it and the
row was counted but not written. Converting a label's property in key
ranges left every range after the first unconverted. A value that looks
unchanged is now compared with the stored one.
Security
- The image names its user. The Dockerfile sets
USER 65532:65532, the
distrolessnonrootuser the image already ran as, so data volumes
created by earlier 3.x images keep working. - Release builds check the Rust installer. The Linux release build
downloads a pinnedrustup-initand checks its SHA-256 before running
it, instead of pipingsh.rustup.rsinto a shell. - Workflows pass named secrets. The Docker Hub description workflow
receives onlyDOCKER_HUB_PASSWORDfrom the publish workflow, not every
repository secret. - Smaller build context.
.dockerignoreleaves out.envfiles and
*.pem/*.keyfiles, Dependabot waits 7 days before proposing a newly
published version, and the upgrade-check scripts copy symbolic links as
links.