Kandra 0.4.7 is the largest release so far. No version was cut between 0.4.6 in July and this one, so it brings together 66 pull requests from three rounds of adversarial review. Each round tried to break what the previous round had fixed, and several fixes in this release correct regressions introduced by an earlier fix in the same cycle.
Read the changelog for the full list. This post covers the theme behind it and what you need to check before upgrading.
The theme: no silent fallbacks
A partition-oriented database punishes you later, not now. A query that scans the whole cluster works fine on a laptop. A retry that re-applies a conditional write looks like resilience until two writers both "win". Most of 0.4.7 removes places where Kandra quietly did something reasonable instead of telling you that what you asked for has a cost.
Behavior changes to check before upgrading
findActive()no longer falls back toALLOW FILTERING. If the soft-delete marker column has no@SecondaryIndex, it throwsKandraQueryExceptionunless you passallowFullScan = true. The soft-delete recipe shows both options.- Suspend and blocking batches have separate scope types.
batch { }gives youKandraBatchScopeandbatchBlocking { }gives youKandraBlockingBatchScope, so using a blocking repository inside a suspend batch is now a compile error. See multi-table writes. - Versioned
update()runs exactly once. It used to retry on transient errors, which could re-apply a lightweight-transaction write that had already succeeded. See optimistic locking. - Invalid consistency levels are rejected up front.
EACH_QUORUMfor reads andSERIAL/LOCAL_SERIALfor writes throw before they reach the driver. AUTO_MIGRATEwon't add a missing key column. Adding a partition or clustering column withALTER TABLEwould silently change row identity, so it throwsKandraSchemaExceptioninstead.
Most of these changes turn a silent problem into an exception. Code that "worked" on 0.4.6 can
start throwing on 0.4.7, and that is the point. KandraTestcontainers catches these before
production. FakeKandraSession can't, because it doesn't model the
data-plane semantics involved.
New APIs
saveAndGet(),saveIfNotExistsAndGet()andupdateAndGet()return the entity as it was persisted, so you don't need a second read.throttle { }adds opt-in admission control, and rejected requests surface asKandraThrottledException.PoolConfignow sets local and remote connection-pool sizes.- Consistency Strict Mode for multi-DC deployments.
kandra-codegengenerates typed Koin and Kodein accessors.debug { rawQueryStrictMode = true }makes theraw()injection guard throw instead of warn.
Fixes worth upgrading for
- Predicate values now go through codecs, so
eq,gt,ltandinwork on non-primitive columns.append()andremove()work onSet<T>columns again. - Cache hits, lookup-index reads and versioned-update lookup writes respect your configured consistency, and an invalidate-after-write race that could pin a stale cached value is closed.
- SSL settings are enforced, and the TLS minimum version fails closed.
- Unbounded
findActive()calls and unpaged reads are capped instead of risking running out of memory.
Multi-DC support is now documented as experimental. It hasn't been validated against a real multi-region topology yet.
Upgrading
Bump the BOM and every Kandra module follows:
dependencies {
implementation(platform("ke.co.coinx.kandra:kandra-bom:0.4.7"))
implementation("ke.co.coinx.kandra:kandra-runtime")
implementation("ke.co.coinx.kandra:kandra-ktor")
}Then search your code for findActive(, batch { and versioned update( calls, and run your
integration tests against a real cluster. If something now throws, the message names the entity,
the column and the reason.