The `Clone` impl for `ClientConnection` would create an independent
instance that could not observe module hotswapping. This would result in
methods called on a replaced `ModuleHost` to fail, because that host
exited already.
Fix by reading the `ModuleHost` from the watch channel directly, instead
of maintaining a redundant copy.
Also fix `watch_module_host` to properly mark the current module host as
seen.
# Expected complexity level and risk
2
# Testing
- [x] test suite passes
- [x] ran @bfops repro script
This patch attempts to integrate the new commitlog with the minimum
changes.
Most of the diff comes from deletions of the legacy log and the need to
adjust tests due to the requirement for a tokio runtime when a durable
database is used in tests.
The "meat" of the patch are the `RelationalDB` constructors,
`RelationalDB::commit_tx`, and the replay logic in
`locking_tx_datastore`.
While `DataKey` is gone, there is still some redundant data being passed
around, which will be addressed in the follow-up patch.
* Implement (but do not use) a fast path for BFLATN -> BSATN conversion
* fmt and clippy
* `u16` offset rather than `usize`
* Address Joshua's review
* Define methods on `RowRef` and `RelValue` which use the new serializer
* Comment in `align_to` about div-by-zero
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
* Add benchmark comparing BFLATN -> BSATN with and without the fast path
* Add benchmark on `u64_u64_u32`, which has less interior padding than `u32_u64_u64`
* Remove `to_len` from `to_bsatn_extend`
It turns out to be slower than just eating the `realloc`s.
* Remove unused `to_bsatn_slice`
I thought I would need it, but it ended up not being useful.
* Expand comment with example; `Box<[...]>` to reduce memory footprint
* Comments from Mazdak's review
---------
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
- Move it and friends from sats to vm.
- MemTable now stores a Vec<PV>.
- Other related improvements.
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
* made MutTxId -> MutTx
* adopt using ass. type for tx
* fmt
* read tx in datastore
lint
test
lint
made MutTxId -> MutTx
adopt using ass. type for tx
fmt
added more methods to TxId
fix test
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
comments on Test
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
fmt
typo
* fix imports
* clippy
* read tx in datastore
lint
test
lint
added read tx in subs
fmt
fix iters
* comments
* comments
* fix schema_for_table
* fmt
* merge queue helped
* moved all_read_query anaylyzing to vm
* lint
* added StateView trait
* lint
* fix tests for read-tx-in-subs (#695)
Intention of this PR is to keep diff of main PR smaller - feat: subscription to use read type tx #685 by separating trivial unit test related changes from main logic.
naming changes begin_tx() -> begin_mut_tx() and begin_read_tx() -> begin_tx()
* rollback_tx -> release_tx
* Compiler should work with Write Tx
* execute sql with mut tx
* fix result len
* compiler to work with write tx (#716)
* Compiler should work with Write Tx
* merge queue helped
* Refactoring bootstrapping and adding full support for constraints & multi-column indexes
* Removed deleted code and add some comments
* Add comment for Constraints
* Update crates/core/src/db/datastore/locking_tx_datastore/mod.rs
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
* Update crates/core/src/db/datastore/locking_tx_datastore/mod.rs
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
* Addressing some PR comments & remove cloning
* Adding details for when fail to decode rows in replay
* Apply Kim's fix for replay bug
* Addressing some PR comments
* Merge
* Fix conflicts
* Fix conflicts
* Fix test
* Fix generation of code for csharp & typescript, now it generate FilterBy for all columns
* Fix for index generation
* Fixing C# index generation
* Merge
* Fix compilation on csharp bindings
---------
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
* Moving object defs to SATS
* move ColumnIndexAttribute to primitives, nix path attr
* revert unnecessary reformating
* ProductValue: don't take ColId
ProductValues can be more than rows and can be nested
* simplify sats::db::def wrt. Constraints + impl ser/de
* cargo fmt
---------
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Closes#463.
This metric is maintained by the datastore iterator.
It is written to the metric store when the iterator is dropped.
Only committed rows are counted.
Closes#456.
Closes#461.
Define an execution context for database operations.
Store the database id in RelationalDB.
Record metrics for rows [inserted|deleted] on commit.
* Add script to summarize benchmark results
* Mess with github actions benchmark script
* Formatting fixes
* Comment
* Bring back commit comments, upload to DO Spaces
* Remove cache
We now have servers for benchmarks outside of GH infrastructure and
downloading cache takes way more time than its worth it
* base and head refs are not needed anymore
* Run benchmarks only on master
* Test a branch build
* Fix branch becnhmarks path
* test
* Run only on master again
---------
Signed-off-by: Piotr Sarnacki <drogus@gmail.com>
Co-authored-by: Piotr Sarnacki <drogus@gmail.com>
Closes#414.
Adds a test for calling iter_by_col_eq with multiple columns.
Ensures the index is scanned if an applicable multi-column index is present.
To write this test, iter_by_col_eq was updated to take multiple columns.
* Reverts benchmarks portion of "Bench for SQL scan / where (#370)"
This partially reverts commit 05956d6.
* Get benchmarks runner to remember what it has installed, hopefully
* Fix build error