Skip to content

v5.1.0

Choose a tag to compare

@guycipher guycipher released this 01 Oct 10:11
· 5 commits to master since this release
d5bcc22

TideSQL 5 MINOR (v5.1.0)

This minor moves the engine onto TidesDB v10.1.0. Unique secondary indexes are now enforced across concurrent snapshot transactions, and bulk statements no longer get committed short under the new library. The release fixes several wrong-result bugs in MIN/MAX/COUNT over primary key and index prefixes (some visible only on MariaDB 13) and a server crash under concurrent load. It also adds new status counters and makes building through the MariaDB foundry easier.


Highlights

  • Built on TidesDB v10.1.0. The fallback library build, the installer fallback and the CI matrix are pinned to the v10.1.0 tag.
  • Unique indexes hold under concurrency. Two snapshot transactions that insert the same unique value now conflict at commit instead of both succeeding.
  • Bulk loads are no longer silently truncated. INSERT ... SELECT and ALTER TABLE copies under 10.1.0 could stop early and commit only part of the data, with no error. That is fixed, and concurrent bulk loaders no longer conflict with each other.
  • Correct MIN/MAX/COUNT over prefixes, including empty and missing prefixes, on MariaDB 11.4 and 13.
  • Crash fix for handlers shared through the table cache under concurrent load.
  • No data migration needed.

Correctness

  • Unique secondary index enforcement. Each unique value now also writes a sentinel, keyed by table, index and value, into the reserved __tidesdb_uniq column family. Two writers of the same value therefore conflict at commit, even under snapshot isolation. (4c314c3)
  • Truncated bulk statements. Bulk statements used to reset the connection transaction partway through. Under TidesDB 10.1.0 this ended the source scan of an INSERT ... SELECT or an ALTER copy early and committed the result short with no error. Now each batch continues in a fresh transaction, and the committed batches are freed when the transaction ends. (4c314c3)
  • MAX behind an equality prefix returned NULL. The backward seek started from the bare prefix and stopped one entry early. The primary key part is now padded to its full length before seeking. (4c314c3)
  • MAX over an empty index prefix on newer servers. When no row existed at or below its target, a backward primary key lookup landed on a table meta key. It was then stepped forward to the table's first row. MariaDB 11.4 discarded that row by checking the prefix itself, but MariaDB 13 returned it as the answer. A backward lookup that does not land on a data key now finds no row. A prefix-last read now verifies the prefix on both the primary key and secondary index paths. (0cc90b6)
  • Missing composite primary key prefixes. A lookup on the leading columns of a composite primary key returned the first key at or after the prefix without checking that it carried the prefix. A prefix with no rows therefore read back the first row of the next prefix. This gave a wrong COUNT or MAX on any server, and it failed CI on MariaDB 13, which plans that MAX as a primary key lookup. The read now reports not found when the row does not match. (4252964)
  • Undecryptable rows.*A row that fails to decrypt now fails the statement, instead of reading back as zeroed columns. An in-place index build that meets such a row now stops. (4c314c3)

Stability

  • Crash under concurrent load. The scan iterator is now freed at the end of every statement. Previously it was kept, so another connection that picked up the handler from the table cache could free it while the owner was committing. That crashed the server. (4c314c3)
  • Fewer spurious lock wait timeouts. The wrappers now retry transient "locked" results from the library briefly, instead of passing them to the client as lock wait timeouts. (4c314c3)

Performance

  • Bulk loaders run without conflicts. A clean transaction whose statement will reach the batch threshold switches to read committed up front, so concurrent bulk loaders no longer conflict. (4c314c3)
  • IN lists use one iterator. The equality ranges of an IN list now reuse one iterator per statement, instead of opening a bounded iterator for each value. (4c314c3)

Configuration and observability

  • tidesdb_max_open_sstables now defaults to 0, which means the library default of 1024. (4c314c3)
  • New status counter tidesdb_commit_conflicts. (4c314c3)
  • New tidesdb_stmt status counters, broken down by cause. (4c314c3)

Build and packaging

  • MariaDB foundry support. When built outside the server source tree, the plugin now includes CPack itself, as MariaDB requested. This is needed because mariadb_add_plugin no longer does it for projects that add several plugins. Inside the server tree, CPack is left to the server. (4c314c3)
  • Optional compression backends. The fallback library build enables each compression backend (zstd, lz4, snappy) only when its library and header are present. A builder without them now gets an engine without that compression, instead of a failed build. (4c314c3)

Testing

  • New MTR tests:
    • tidesdb_minmax_prefix: MIN/MAX behind equality prefixes, including lookups of missing prefixes.
    • tidesdb_unique_concurrent: concurrent unique inserts.
    • tidesdb_encryption_bad_key: reading rows with the wrong encryption key.
    • tidesdb_eq_range_reuse: iterator reuse for IN lists.
  • tidesdb_encryption_bad_key reads every row by key rather than a single row. The row envelope has no integrity check, so a wrong key can decrypt one row to garbage that passes the cipher's padding check about one time in 256. (0cc90b6)
  • The Galera suite config again includes the line that disables SSL for state transfers. (4c314c3)

https://tidesdb.com
https://github.com/tidesdb/tidesql/pull/160/commits