# Description of Changes
Now running `python -m smoketests` no longer updates
`smoketests/config.toml` with a new identity, and also `replication`
doesn't fail when docker isn't available.
# Expected complexity level and risk
1
# Testing
- [x] those things no longer happen
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
Implements [subscribing to durable
commits](https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1594).
The setting works on a per-connection level, and essentially just delays
sending transaction updates until the transaction is reported as durable
by the database.
For connectionless SQL operations, the setting works per-request. No SQL
syntax is provided by this patch to toggle the configuration.
After some deliberation, I opted to obtain the offset when a transaction
commits (as opposed to when it starts). This creates some mild
inconvenience, because we prevent the transaction from committing until
the corresponding subscription updates are enqueued.
The strategy is, however, more correct should we ever support weaker
isolation levels, and it is easier to document.
Follow-ups include:
- Provide SQL syntax (`SET synchronous_commit = ON` or something)
- C# and TypeScript SDKs
- Reference docs?
# API and ABI breaking changes
Not breaking, but adds a parameter to the subscribe and sql endpoints.
# Expected complexity level and risk
4
To the author's understanding, ordering of outbound messages is not
changed by this patch, even if there are messages that don't have a
transaction offset (such as error messages). I.e. while waiting for the
transaction offset of a message to become durable, no message enqueued
after that message will be delivered. This may not be desirable in some
cases.
The patch may contain concurrency bugs, e.g. awaiting futures that may
never resolve.
# Testing
- [x] Implemented a new test in the `module_subscription_actor` module
- [x] Added unit tests for the core logic in `ClientConnectionReceiver`
It would be desirable to also have integration-level tests, but I'm
currently unsure how to write those without being able to control if and
when the database reports an offset as durable.
---------
Signed-off-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
# Description of Changes
This enables smoketests to run against remote servers, such as maincloud
/ maincloud staging.
I also added a `--spacetime-login` param, for servers that require a
"proper" spacetime login (such as both servers above).
Usage:
```bash
python3 -m smoketests \
--remote-server https://maincloud.staging.spacetimedb.com \
--spacetime-login \
-x replication # for some reason this is required, even though I swear it should be disabled by not passing `--docker`
```
# API and ABI breaking changes
None. CI only.
# Expected complexity level and risk
1
# Testing
- [x] Smoketests pass on this PR
- [x] Smoketests pass when run against maincloud staging (using the
instructions above)
- [x] Manual review to check whether I've accidentally de-fanged any
"test for negative case" tests
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Until we have confirmed reads, we need to wait for a tick until any
batched commits are flushed.
Also cleaned up the code a bit to do less string manipulation of sql
results all over the place, and to output less irrelevant logging.
# Expected complexity level and risk
1
# Testing
- [x] yes