v0.2.2 — silent bulk-load data-loss fix (unified_memtable default OFF)
TidesDB MySQL plugin — v0.2.2
Correctness release on top of v0.2.1. One critical fix that changes a
default to make the engine safe out of the box, one latent silent-loss
fix in the bulk-commit path, and the reverse-ref/OSTAT handler fix that
landed on main between tags.
Tests: 61/61 MTR pass (the tidesdb_unified_memtable test now opts
into the unified path explicitly via a -master.opt so it stays
covered after the default flip). HammerDB 5.0 TPROC-C WARE=20 / BUILDVU=8
/ RUNVU=16 verified PASS out of the box (2511 NOPM, 0 handler-unsupported
errors, schema build + reverse-ref/OSTAT clean).
What changed
Correctness (CRITICAL — silent data loss)
-
Default
tidesdb_unified_memtable=OFF. The TidesDB v9.2.0 unified
WAL+memtable path silently loses committed rows under many concurrent
writers. HammerDB TPROC-C at WARE=20/BUILDVU=8 dropped ~95% of
bulk-loaded rows (MIN(o_id)=3001across every district while
district.d_next_o_id ~ 3000— 100% of build-phase rows gone, only
post-build single-row inserts survived). Everytidesdb_txn_commit
returnedTDB_SUCCESSand all loaders reportedFINISHED SUCCESS.
Refuted handler-side hypotheses (skip_listdeep-copies key+value,
ruling out txn_reset-after-commit corruption) and visibility lag
(stable across 20s of repeated reads). Flipping the same handler
binary to per-CF memtables produced a 100%-correct build. Until the
engine fixes the rotation race, default the sysvar to OFF so
correctness holds out of the box. Opt back in explicitly with
tidesdb_unified_memtable=ONfor low-concurrency multi-table OLTP.MTR coverage of the unified path is preserved via a per-test
tidesdb_unified_memtable-master.optthat forces ON for that one
test. Four result files were regenerated; their previous baselines
encoded unified-mode degenerate stats (literalFAIL: DATA_LENGTH is 0intidesdb_info_schema, bogusrows=2afterANALYZEthat
prevented MRR) — per-CF correctly reports non-zero data length,
accurate row counts, and the optimizer now picks range/MRR scans on
IN-lists.
Correctness (HIGH — latent silent loss in bulk path)
maybe_bulk_commitno longer silently swallows a failed mid-batch
commit. A failedtidesdb_txn_commitin the bulk insert/update/
delete path was downgraded to an info log;tidesdb_txn_resetthen
discarded the batch's buffered ops, yet the function returned 0, so
the caller saw success and the loader reportedFINISHED SUCCESS
while up toTIDESDB_BULK_INSERT_BATCH_OPS(500) rows per batch were
silently lost. The fix retries transient resource errors (TDB_ERR_ CONFLICT/LOCKED/MEMORY_LIMIT) up to 4 attempts with a short
backoff —tidesdb_txn_commitreturns these errors before marking
the txn aborted, so the buffered ops survive and re-committing is
safe — then on non-transient errors or exhausted retries returns the
mapped error without resetting the txn, so the SQL layer rolls the
statement back instead of corrupting the table.
Correctness (HIGH — handler API)
- Reverse-ref / OSTAT (
ER_ILLEGAL_HAonORDER BY pk DESC LIMIT 1).
ha_tidesdbnow implementsindex_read_last_mapand fixes the
partial-prefixHA_READ_PREFIX_LASTseek so that
WHERE w_id=? AND d_id=? ORDER BY o_id DESC LIMIT 1(the exact
TPC-C Order-Status query) no longer surfaces error 1031. Verified
via 6 dedicated MTR cases plus a full HammerDB 5.0 TPROC-C build+run.
Pull
docker pull evgeniypatlan/test-images:mysql-9.7-tidesdb-v0.2.2
Digest: sha256:7dc1d358470ed9c13e5cf31b189e61dc2ae0572a6b8557467454d172a0131bb3
Also tagged mysql-9.7-tidesdb-latest.