1 ماه پیش | 54 تغییر در main پس از این انتشار
Requested by smartbotic-vectorapi. The design was agreed before any code was written.
using F = smartbotic::database::Client::Filter;
auto hits = db.similaritySearch("kb_chunks", queryVec, 500, 0.0f,
{F::eq("departmentKey", "webber")});
find(). All eleven operators work, multiple filters are ANDed, and indexes are used exactly as find() uses them. Matching ids and vectors are read in one LMDB read transaction.minScore trims after the filter. A filter matching fewer rows than topK returns all of them. A filter that matches nothing, or names a field no row carries, returns empty; neither is an error.filters_applied in the response. When the client sent filters and that field is false, it throws Client::FailedPrecondition with reason filters_unsupported instead of returning the rows. Verified against the released 2.13.1 image.minScore 0.0 drops rows whose cosine is NEGATIVE. Pass -1.0 to rank every row.SEARCH operator ignores its field: it is a case-insensitive substring match over the whole document, here as in find().12,447 rows, dim 4096, best of 5, dev container:
| query | time |
|---|---|
| unfiltered, top 500 | 187 ms |
| filter matching ~430 rows, top 500, unindexed | 78 ms |
| same, indexed | 51 ms |
| same, indexed, top 5 | 13 ms |
| filter matching 1/7 of rows | ~90 ms |
| filter matching nothing | 0.8 ms |
vectorapi's emulation of the filtered query took 3.21 s on prod.
test_filtered_similarity (417 checks). The oracle is the unfiltered full ranking restricted to the ids find() returns for the same filters. It runs for every operator, conjunctions, three queries, topK 1/5/50/500, and again with indexes declared, including an EQ-scalar on an array field whose index candidates must be re-judged.test_policy_enforcement gained 6 checks.Packages: apt trixie 2.14.0-1. The zeus container runs 2.14.0.
1 ماه پیش | 59 تغییر در main پس از این انتشار
A row could grow past the gRPC send limit one small patch at a time (found by smartbotic-vectorapi: insert 60 MiB, patch +20/+10/+10, every request accepted). After that it could never be read or exported.
A write whose stored document would exceed the server's send limit (less 256 KB) is now refused with InvalidArgument, reason document_too_large:
insert / update / upsert / batch body, before parsing;patch, before anything is changed.Rows already that large stay as they are (export: row_too_large, get: message_too_large).
The deadline can expire while the server finishes a write. The client used to retry every write on DeadlineExceeded, which repeated writes that had happened:
Now:
DeadlineExceeded on a write is retried only when idempotent: a plain patch, or an upsert with an id.outcome_unknown. Check the row before redoing the write; do not map it to "retry as-is".timeoutMs plus 1 s per 4 MiB.update() retries only version conflicts. It used to retry every refusal (read-only, memory pressure, size, outage) and log them as version conflicts.connect() connectsconnect() returned true and logged "connected" without opening anything, even against a dead port (reported by smartbotic). It now waits up to timeoutMs for a real connection and returns false when unreachable. The client stays usable: gRPC keeps reconnecting on later calls.
isConnected() counts an idle or connecting channel only after a successful attempt.
document_too_large; before, they were stored and could not be read back.outcome_unknown. insert, increment, conditional writes and deletes are no longer retried after a timeout.connect() takes up to timeoutMs and returns false. A caller that retries connect() in a loop bounded by an attempt count must check its total bound: 30 attempts went from about 30 s to up to 180 s with the default 5 s timeout, which can outrun systemd TimeoutStartSec when a service starts while the database is down (found by smartbotic-vectorapi). Bound such a loop by a wall-clock deadline.test_read_failures: its frozen-server phase tells retried from not-retried writes by timing and checks outcome_unknown. connect() is checked in every phase.test_export: its later phases run at a 2 MB send limit and check the guard (insert, upsert, update and a growing patch refused, the row untouched).outcome_unknown 3, connect() 2). update()'s conflict-only retry is not pinned by a test: the answer is the same either way, and only the wasted calls differ.debian:trixie with both changed suites built against the installed -dev package: 271 checks.Correction to the 2.13.0 notes: its ctest count was 24/24, not 25/25.
Packages 2.13.1-1 on repository.smartbotics.ai (trixie).
1 ماه پیش | 61 تغییر در main پس از این انتشار
Requested by smartbotic-vectorapi. get/find/similaritySearch never returned a stored embedding (the server moves _vector into the vector index on write), so an export of a vector collection would have re-imported as unsearchable JSON. The design was agreed with vectorapi before any code, and vectorapi ran a pre-release test at scale before this tag.
get / find with Client::WithVector{} return the stored vector as "_vector": [floats], the field insert takes.ExportCollection / Client::exportCollection() streams one collection, documents plus optional vectors.
afterId never repeats a row.complete=false and a resume cursor.VectorState, reported as stored, never guessed: Present, None, Missing (written with a vector, entry gone), Unknown (no entry, row predates 2.13.0). A has-vector marker on the stored document tells them apart. Every 2.13.0 write records it (insert, update, upsert, patch, restore).insert(collection, row.document, row.id) with the vector gives the same fields and a byte-identical, searchable vector, but fresh metadata (the originals stay in the export).deleteFile / setFileTtl Failure& overloads: NotFound vs the real code.row_too_large, conflicting_id); gRPC's own size refusal gets reason message_too_large.Missing). They are now one transaction. At the store level, the old shape shows 16,592 false Missing rows across 71,925 concurrent exports; the fix shows 0 across 8.36 M rows._id, _version, _created_at, ...) as hidden fields that every read then masked. The server now strips them on every write.subscribeEvents handler terminated the consumer process. The event is now logged and dropped._id / _version / _created_at / _updated_at / _created_by / _updated_by are no longer stored. No read ever showed them.subscribeEvents handler exception no longer ends the process; that event is dropped.ResourceExhausted from gRPC's size limit now carries reason message_too_large. The code is unchanged.patch calls, and is then unreadable.DeadlineExceeded after it was applied, and then be retried.test_export_scan. e2e 18/18, including the new test_export: 89 checks plus an on-disk check, covering the round trip, resume, refusals, payload edges, a restart, a race and an outage.Missing, six unstamped report Unknown, and the other 12,712 are byte-identical.debian:trixie, with the export e2e built against the installed -dev package: 90/90. The install also confirms the server package now depends on adduser.Packages: smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli 2.13.0-1 on repository.smartbotics.ai (trixie).
1 ماه پیش | 67 تغییر در main پس از این انتشار
Reported by smartbotic-vectorapi. Client::get returned nullopt for every failed gRPC status except PERMISSION_DENIED, so UNAVAILABLE / DEADLINE_EXCEEDED came back as the same value as "no such document". A transient blip became a definite 404. A careful client cannot retry that, and one consumer lost a six-minute ingest of an 8 GB mailbox to it.
Checking every read found the same shape on about twenty of them:
exists (false), count (0)find / findWithMetrics (empty; they threw only on NOT_FOUND)setMembers, setIsMember, getVersionHistory, getDocumentVersionlistCollections, listProjects, listIndexes, listCompositeUniqueIndexes, indexValues, listViews, listRelationsgetCollectionInfo, getViewInfo, getRelationInfohasCollectionConfig (false) and getCollectionConfig (silently the DEFAULTS)A read whose "nothing there" value is also a valid answer throws Client::Error (with code()) on ANY failed status. A genuine absence still returns nullopt / false / 0 / empty and does not throw. This is safe because the server reports every absence in-band; only Find uses a NOT_FOUND status, and that already threw.
healthCheck (false), getHealthInfo / getStats (nullopt), getRelationsEnforced (fails toward true), tryGetRelationsEnforced (nullopt). Writes keep their return values plus Failure& / FailureDetail&.update() read through get() and reported an outage as NotFound "document not found". It now records the real code.Code that calls these reads without a try now sees a throw during an outage, as soon as the library is upgraded. Catch Client::Error and map code(): Unavailable / DeadlineExceeded mean try again later, not 404. On a project with security enabled (none today), a denied schema read (listRelations, getRelationInfo, ...) now throws PermissionDenied instead of answering empty. Consumers were notified with their call sites. smartbotic must catch in StorageClient and the webserver scheduler before its hosts take this library.
tests/load_test/test_read_failures (port 9022) drives 24 reads through three server states: up (genuine absences stay empty and are not thrown), SIGSTOPped (DeadlineExceeded) and stopped (Unavailable). That is 160 checks. Reverting the client fails 49 of the 54 frozen-server checks.-dev package: 160/160.Packages: smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli 2.12.4-1 on repository.smartbotics.ai (trixie).
1 ماه پیش | 69 تغییر در main پس از این انتشار
A bug-fix release. smartbotic-vectorapi asked four questions about the file store before building on it; answering them from source found three defects.
File records live in a global tree, not in the project's own storage, so dropProject left every file behind, and they were served to a later project of the same name. dropProject now deletes each of the project's files through the reference-counted path, so bytes another project also holds are kept.
storage.files.max_file_size_mb (default 500) was checked only after the server had received and buffered the entire upload, so an oversized upload cost its full size in memory before being refused, and the refusal arrived as Internal. The server now stops reading at the limit and refuses with ErrorCode::InvalidArgument, reason file_too_large. A type outside storage.files.allowed_types is refused the same way, with reason mime_type_not_allowed.
Measured: a 64 MB upload against a 1 MB cap raises the server's peak memory by 5-12 MB with the fix, and by 81 MB without it.
A download now streams the file from disk in 64 KB chunks.
max_memory_mb.listFiles has an exact-name filter.max_file_size_mb.Client::errorDetail(e) reports the reason.test_file_store: a peak-memory check on a fresh server, 18 functional checks, and 3 more after a restart.smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli, all 2.12.3-1, in repository.smartbotics.ai, suite trixie.
1 ماه پیش | 71 تغییر در main پس از این انتشار
A bug-fix release. Reported by smartbotic-vectorapi; the project part was found by the new test.
dropCollection removed the documents, but not the collection's configuration: declared indexes, unique and composite constraints, relations_enforced, versioning and timestamp precision. Their index data was left behind too. A later collection of the same name silently inherited a unique constraint nobody declared: a legitimate write was refused as a duplicate, and re-declaring the index answered already_existed instead of validating the new data.
Now dropCollection removes all of it, so a new collection with the same name starts clean.
Once a collection's project storage was gone, dropIndex refused ("secondary indexes require the LMDB substrate") and dropCollection returned false, so the name stayed poisoned. Both now clear leftover declarations even when the collection or its project no longer exists. A name poisoned by an older version can be repaired with either call.
dropProject removed the project's storage, but its collections stayed in memory and in the write-ahead log. Dropped documents were still served (re-inserting a dropped id said "already exists"), and a restart would have replayed them back. Now each of the project's collections is dropped properly, with a write-ahead log record so a restart cannot resurrect it, and every configuration record under the project is removed. This runs only after the project drop succeeds, so a refused drop (default) cannot destroy data.
client/ is untouched since 2.12.1, and the library exports the same 7174 symbols with the same soname. Consumers need no rebuild.test_drop_cleans_declarations: 26 checks, plus 11 after a server restart. It includes the poisoned state older versions left behind, recreated by loading a configuration record for a project with no storage.smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli, all 2.12.2-1, in repository.smartbotics.ai, suite trixie.
1 ماه پیش | 73 تغییر در main پس از این انتشار
A bug-fix release. Upgrade any install where memory eviction can fire.
In every v2 release, once MemoryStore evicted a document under memory pressure, writes to it misbehaved. Reads are served from LMDB, so nothing ever brought the document back, and every write path looked only in memory. Measured on 2.12.0 with real eviction, 200 of 200 each:
patch / update: failed as "not found"remove: returned false, and the document stayedinsert with its id: accepted, and overwrote the existing documentupsert: re-created it at version 1Every write path now reloads an evicted document before acting on it. If the reload fails, the write is refused (Internal) rather than treating the document as absent.
Who was exposed: only databases where eviction has run. The packaged default budget is storage.memory.max_memory_mb = 512, and the size estimate runs about 5x below real memory. Check the periodic server log line Memory check: ... N docs, M evicted: M > 0 means writes to those documents were affected. A restart reloads everything into memory.
Internalinsert with an id that already exists now fails with ErrorCode::AlreadyExists, reason duplicate_id, and conflictingId set to the id. fields is empty, because the identity collided, not a field. Previously it was an unclassified Internal error.
client/ is untouched since 2.12.0, and the library exports the same 7174 symbols with the same soname. Consumers need no rebuild.test_evicted_writes runs the server with a 1 MB budget so eviction really happens. Reverting the reload fails 7 of its checks (150/150 each); reverting the duplicate-id mapping fails 4.smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli, all 2.12.1-1, in repository.smartbotics.ai, suite trixie.
1 ماه پیش | 75 تغییر در main پس از این انتشار
The database changes smartbotic-vectorapi asked for, plus the event-actor work prepared as 2.11.5. There is no 2.11.5 release: everything ships in 2.12.0.
Client::FailureDetail carries a reason (unique_violation, missing_parent, delete_restricted, read_only, version_conflict, not_found, invalid_increment, memory_pressure, view_write). It also carries the field(s), the colliding value(s), the conflicting document id, the relation, and the current version. Every call that took a Failure& gains a FailureDetail& overload; for calls that throw, use Client::errorDetail(e). The reason also separates read-only mode from relation refusals, which share FailedPrecondition.patchIfVersion(collection, id, fields, expectedVersion, ...) changes one field only if the document is still at the version you read. Exactly one of any number of concurrent claims wins. A stale version is Aborted with currentVersion.increment(collection, id, {{"calls", 1}, {"minutes", 3.5}}, ...) returns the new values and loses no update under concurrency. Absent counts as 0, integer arithmetic stays integer (overflow refused), dotted paths create objects. A refused increment writes nothing.createCompositeUniqueIndex(collection, {"chat_id", "file_unique_id"}). Declaring one over existing duplicates is refused with examples. A document with any component absent or null is not constrained. CLI: unique-create, unique-drop; indexes lists them.null for a unique field, as in SQL. Before, two nulls collided while two absent fields did not.removeManyAs(collection, ids, actor, ...) deletes in one round trip and returns deletedIds in request order. Relations are enforced all-or-nothing.actor that caused it (subscribeEvents(), Client::Event), and removeAs() lets a delete carry one. A consumer that writes in response to events can recognise its own writes, deletes included, and stop a trigger feeding itself.Unknown. They are still in-band, with the message text unchanged.libsmartbotic-db-client.so.2. A binary built entirely against 2.11.4, and the released 2.11.4 CLI, both run unchanged on the 2.12.0 library.Failure.code for update and patch in-band refusals changes from Unknown to the specific code. updateIfVersion on a missing document now reports NotFound (the message is still "Version conflict"). Null no longer collides on unique indexes.libsmartbotic-db-client-dev (>= 2.12.0) and depend on libsmartbotic-db-client (>= 2.12.0).test_event_actor: 56 checks.test_db_changes_for_vectorapi: 87 checks before the restart and 7 after. It includes 8 concurrent claims of one version and 8×50 concurrent increments.smartbotic-database, libsmartbotic-db-client, libsmartbotic-db-client-dev, smartbotic-db-cli, all 2.12.0-1, in repository.smartbotics.ai, suite trixie.
Docs: docs/integration-guide.md, sections "The full reason: FailureDetail", "Indexes and unique constraints", "Batch delete" and "Who caused a change".
1 ماه پیش | 77 تغییر در main پس از این انتشار
Two consumer reports from smartbotic-vectorapi. Client library and CLI only: no wire change, no on-disk change, no server behaviour change.
relations_enforced can be read, and shown. It always could be read with Client::getRelationsEnforced() (since 2.11.0), but nothing said so: the integration guide did not mention relations, and the CLI could set the flag while no command could display it.
smartbotic-db-cli configure-relations <collection> with no value prints the current state.smartbotic-db-cli info <collection> prints relations_enforced.Client::tryGetRelationsEnforced() returns std::optional<bool> for anything that displays the setting. No value means it could not be determined (failed read, or a pre-2.11.0 server). It does not throw.insert, upsert, find, findWithMetrics, similaritySearch, the file calls, and get/exists/count on a denial) throw Client::Error, which carries code(). Client::AlreadyExists, Client::FailedPrecondition and Client::PermissionDenied are catchable subtypes.false/0 (update, updateIfVersion, patch, patchWithTtl, remove) have new overloads taking a Client::Failure& with code and message.| Condition | Code |
|---|---|
| Unique constraint already held | AlreadyExists |
Child references a missing parent (validate_on_write) |
FailedPrecondition |
Delete blocked by on_delete="restrict" |
FailedPrecondition |
| Access policy denied the call | PermissionDenied |
| Server unreachable / deadline passed | Unavailable / DeadlineExceeded |
libsmartbotic-db-client.so.2. A test binary built entirely against 2.11.3 and the released 2.11.3 CLI were both run against the new library.Client::Error derives from std::runtime_error and what() is unchanged, so existing catch (const std::runtime_error&) and catch (const std::exception&) blocks behave as before.update/patch/remove signatures are untouched and still do not throw.libsmartbotic-db-client-dev (>= 2.11.4) and depend on libsmartbotic-db-client (>= 2.11.4).Update and PatchDocument refuse some writes in-band (status OK, success=false, a message): document not found, version conflict, read-only mode, memory-pressure emergency, a write to a view. Those carry no code on the wire and arrive as ErrorCode::Unknown with the server's text. update() does report a missing document as NotFound.relations_enforced has no separate "never configured" state. Unset and explicitly-on behave identically and both read true; false appears only when someone disabled it.createRelation and configureCollection still return a bare false.smartbotic-database_2.11.4-1_amd64.deblibsmartbotic-db-client_2.11.4-1_amd64.deblibsmartbotic-db-client-dev_2.11.4-1_amd64.debsmartbotic-db-cli_2.11.4-1_amd64.debPublished to repository.smartbotics.ai, suite trixie.
See docs/integration-guide.md: "Relation enforcement on/off" and "Error handling: caller fault or server fault".