Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ the live column family.
Storage:
WRITE_BUFFER_SIZE Memtable size before flush (default: 32MB)
MIN_DISK_SPACE Minimum free disk space (default: 100MB)
KLOG_VALUE_THRESHOLD Values larger than this go to vlog (default: 512)
KLOG_VALUE_THRESHOLD Values larger than this go to vlog (default: 4096)

Compression:
COMPRESSION NONE/SNAPPY/LZ4/ZSTD/LZ4_FAST (default: LZ4)
Expand All @@ -288,7 +288,7 @@ LSM Tree:
MIN_LEVELS Minimum LSM levels (default: 5)
DIVIDING_LEVEL_OFFSET Compaction dividing level offset (default: 2)
L1_FILE_COUNT_TRIGGER L1 file count trigger for compaction (default: 4)
L0_QUEUE_STALL_THRESHOLD L0 queue stall threshold (default: 4)
L0_QUEUE_STALL_THRESHOLD L0 queue stall threshold (default: 8)

Skip List:
SKIP_LIST_MAX_LEVEL Max skip list level (default: 12)
Expand Down
30 changes: 15 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ build_tidesdb() {
fi
fi
if ! $found; then
warn "libtidesdb not found at ${TIDESDB_PREFIX}/lib MariaDB build may fail"
warn "libtidesdb not found at ${TIDESDB_PREFIX}/lib - MariaDB build may fail"
fi
return
fi
Expand Down Expand Up @@ -667,7 +667,7 @@ max_connections = 151

# InnoDB
default_storage_engine = InnoDB
innodb_buffer_pool_size = 128M
innodb_buffer_pool_size = 256M
innodb_log_file_size = 48M
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table = ON
Expand All @@ -681,13 +681,13 @@ long_query_time = 2
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci

# TidesDB plugin loaded at startup
plugin_maturity = experimental
# TidesDB plugin - loaded at startup
plugin_maturity = gamma
plugin_load_add = ha_tidesdb.${plugin_ext}

# TidesDB settings (defaults shown tune as needed)
tidesdb_flush_threads = 2
tidesdb_compaction_threads = 2
# TidesDB settings (defaults shown - tune as needed)
tidesdb_flush_threads = 4
tidesdb_compaction_threads = 4
tidesdb_block_cache_size = 268435456
tidesdb_max_open_sstables = 256
tidesdb_log_level = WARN
Expand Down Expand Up @@ -735,7 +735,7 @@ max_allowed_packet = 64M
done

if [[ -z "$install_db" ]]; then
warn "Could not find mariadb-install-db skipping data directory init"
warn "Could not find mariadb-install-db - skipping data directory init"
warn "You may need to run it manually after installation"
elif [[ -d "${datadir}/mysql" ]]; then
warn "Data directory already exists at ${datadir}, skipping initialization"
Expand Down Expand Up @@ -825,7 +825,7 @@ print_summary() {
draw_box "${GREEN}" "Installation Complete!" _summary_lines
}

# ── PGO Phase 1 —— Instrument build ─────────────────────────────────
# ── PGO Phase 1 -- Instrument build ─────────────────────────────────
pgo_instrument() {
info "PGO Phase 1/3: Building MariaDB with profiling instrumentation..."

Expand Down Expand Up @@ -907,15 +907,15 @@ pgo_instrument() {
ok "PGO Phase 1/3: Instrumented build complete"
}

# ── PGO Phase 2 —— Train run MTR to generate profile data ────────
# ── PGO Phase 2 -- Train - run MTR to generate profile data ────────
pgo_train() {
info "PGO Phase 2/3: Running TidesDB test suite to generate profile data..."

local mariadb_src="${BUILD_DIR}/mariadb-server"
local mtr_dir="${mariadb_src}/build/mysql-test"

if [[ ! -f "${mtr_dir}/mtr" ]]; then
die "MTR not found at ${mtr_dir}/mtr instrumented build may have failed"
die "MTR not found at ${mtr_dir}/mtr - instrumented build may have failed"
fi

# Run the tidesdb test suite as the training workload
Expand All @@ -932,7 +932,7 @@ pgo_train() {
# Clang generates .profraw files; merge them into a single .profdata
profile_count="$(find "${profile_dir}" -name '*.profraw' 2>/dev/null | wc -l)"
if [[ "${profile_count}" -eq 0 ]]; then
die "No profile data generated in ${profile_dir} PGO training failed"
die "No profile data generated in ${profile_dir} - PGO training failed"
fi
info "Merging ${profile_count} .profraw files..."
xcrun llvm-profdata merge -output="${profile_dir}/default.profdata" \
Expand All @@ -941,14 +941,14 @@ pgo_train() {
# GCC generates .gcda files
profile_count="$(find "${profile_dir}" -name '*.gcda' 2>/dev/null | wc -l)"
if [[ "${profile_count}" -eq 0 ]]; then
die "No profile data generated in ${profile_dir} PGO training failed"
die "No profile data generated in ${profile_dir} - PGO training failed"
fi
fi

ok "PGO Phase 2/3: Training complete (${profile_count} profile files generated)"
}

# ── PGO Phase 3 —— Optimized rebuild using profile data ─────────────
# ── PGO Phase 3 -- Optimized rebuild using profile data ─────────────
pgo_optimize() {
info "PGO Phase 3/3: Rebuilding MariaDB with profile-guided optimizations..."

Expand Down Expand Up @@ -1033,7 +1033,7 @@ main() {
prepare_mariadb

if $PGO_ENABLED; then
info "PGO enabled —— performing 3-phase build (instrument ⤍ train ⤍ optimize)"
info "PGO enabled -- performing 3-phase build (instrument ⤍ train ⤍ optimize)"
pgo_instrument
pgo_train
pgo_optimize
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/tidesdb/include/cleanup_tidesdb.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
disable_query_log;
ALTER DATABASE test DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
enable_query_log;
5 changes: 2 additions & 3 deletions mysql-test/suite/tidesdb/r/tidesdb_stress.result
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,11 @@ INSERT INTO stress_main VALUES (1002, 'w1_b', 12);
connection writer2;
INSERT INTO stress_main VALUES (2002, 'w2_b', 23);
connection writer1;
connection reader1;
SELECT COUNT(*) AS reader_sees FROM stress_main;
connection writer2;
connection reader1;
SELECT COUNT(*) AS reader_sees FROM stress_main;
reader_sees
8
9
connection writer1;
COMMIT;
connection writer2;
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_alter_crash.test
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ SET autocommit=1;
DROP TABLE t_alt70;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_analyze.test
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ ANALYZE TABLE t3;

--echo # Cleanup
DROP TABLE t1, t2, t3;
--source suite/tidesdb/include/cleanup_tidesdb.inc
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_backup.test
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,5 @@ SET GLOBAL tidesdb_backup_dir = '';
--exec rm -rf $backup_dir
--exec rm -rf $backup_dir2

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ connection default;
DROP TABLE t;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_concurrent_errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,5 @@ disconnect c4;

DROP TABLE t1;

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ connection default;
DROP TABLE t_snap64;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_crud.test
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,5 @@ SELECT * FROM t_drop;
--echo #


--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_data_home_dir.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ SHOW VARIABLES LIKE 'tidesdb_data_home_dir';
SET GLOBAL tidesdb_data_home_dir = '/tmp/test';

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_drop_create.test
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ SELECT COUNT(*) FROM t_trunc57;
DROP TABLE t_trunc57;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_encryption.test
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ SELECT * FROM t_enc_null ORDER BY id;

DROP TABLE t_enc_null;

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_engine_status.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ SHOW ENGINE TIDESDB STATUS;
DROP TABLE t1;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_index_stats.test
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ DROP TABLE t_stats2;


--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_info_schema.test
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ if ($ut2 < $ut1)

--echo # ---- cleanup ----
DROP TABLE t_info_schema;
--source suite/tidesdb/include/cleanup_tidesdb.inc
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_insert_conflict.test
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ connection default;
DROP TABLE t;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_isolation.test
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ DROP TABLE t_snap;


--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_json.test
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ SELECT id, name, age FROM t_json WHERE id = 1;
DROP TABLE t_json;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_online_ddl.test
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ SELECT * FROM t_dup ORDER BY i;
SELECT COUNT(*) FROM t_dup;

DROP TABLE t_dup;
--source suite/tidesdb/include/cleanup_tidesdb.inc
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_options.test
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@ DROP TABLE t_default_iso;
--echo #


--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_partition.test
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,5 @@ DROP TABLE t_show_part;

--echo #
--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_per_index_btree.test
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ SHOW KEYS FROM t2;
DROP TABLE t2;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_pk_index.test
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@ SELECT * FROM t_bigpk ORDER BY id;
SELECT * FROM t_bigpk WHERE id = 9223372036854775807;

DROP TABLE t_bigpk;
--source suite/tidesdb/include/cleanup_tidesdb.inc

1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_rename.test
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,5 @@ DROP TABLE t_nopk;
--echo #
--echo #

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_replace_iodku.test
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,5 @@ DROP TABLE t_rep_auto;


--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_savepoint.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ SELECT * FROM t_sp ORDER BY id;
DROP TABLE t_sp;

--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_sql.test
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,4 @@ DROP TABLE emp_projects;
DROP TABLE projects;
DROP TABLE employees;
DROP TABLE departments;
--source suite/tidesdb/include/cleanup_tidesdb.inc
9 changes: 4 additions & 5 deletions mysql-test/suite/tidesdb/t/tidesdb_stress.test
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,13 @@ send INSERT INTO stress_main VALUES (2002, 'w2_b', 23);
connection writer1;
reap;

# Reader1: read while writers are active
connection reader1;
send SELECT COUNT(*) AS reader_sees FROM stress_main;

connection writer2;
reap;

# Reader1: read after both autocommit writers finished
# writer1 txn is still open (uncommitted), writer2 rows are committed
connection reader1;
reap;
SELECT COUNT(*) AS reader_sees FROM stress_main;

# Writer1: commit the transaction
connection writer1;
Expand Down Expand Up @@ -549,4 +547,5 @@ DROP TABLE stress_main;
DROP TABLE stress_nopk;
DROP TABLE stress_wide;

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_ttl.test
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,5 @@ DROP TABLE t_ttl_priority;

--echo #
--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_vcol.test
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,5 @@ DROP TABLE t_vcol_show;

--echo #
--echo #
--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
1 change: 1 addition & 0 deletions mysql-test/suite/tidesdb/t/tidesdb_write_pressure.test
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,5 @@ disconnect wr4;
DROP TABLE sbtest1;
DROP TABLE sbtest2;

--source suite/tidesdb/include/cleanup_tidesdb.inc
--echo # Done.
10 changes: 5 additions & 5 deletions tidesdb/ha_tidesdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ static MYSQL_THDVAR_ULONGLONG(default_bloom_fpr, PLUGIN_VAR_RQCMDARG,
static MYSQL_THDVAR_ULONGLONG(default_klog_value_threshold, PLUGIN_VAR_RQCMDARG,
"Default klog value threshold in bytes for new tables "
"(values >= this go to vlog)",
NULL, NULL, 512, 0, ULONGLONG_MAX, 1);
NULL, NULL, 4096, 0, ULONGLONG_MAX, 1);

static MYSQL_THDVAR_ULONGLONG(default_l0_queue_stall_threshold, PLUGIN_VAR_RQCMDARG,
"Default L0 queue stall threshold for new tables", NULL, NULL, 4, 1,
"Default L0 queue stall threshold for new tables", NULL, NULL, 8, 1,
1024, 1);

static MYSQL_THDVAR_ULONGLONG(default_l1_file_count_trigger, PLUGIN_VAR_RQCMDARG,
Expand Down Expand Up @@ -271,7 +271,7 @@ static MYSQL_SYSVAR_ULONG(max_open_sstables, srv_max_open_sstables,
static MYSQL_SYSVAR_ULONGLONG(max_memory_usage, srv_max_memory_usage,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"TidesDB global memory limit in bytes "
"(0 = auto, 50%% of system RAM; minimum 5%% of system RAM)",
"(0 = auto, 50% of system RAM; minimum 5% of system RAM)",
NULL, NULL, 0, 0, ULONGLONG_MAX, 0);

static MYSQL_SYSVAR_BOOL(log_to_file, srv_log_to_file, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
Expand Down Expand Up @@ -5069,8 +5069,8 @@ maria_declare_plugin(tidesdb){
PLUGIN_LICENSE_GPL,
tidesdb_init_func,
tidesdb_deinit_func,
0x30600,
0x30601,
NULL,
tidesdb_system_variables,
"3.6.0",
"3.6.1",
MariaDB_PLUGIN_MATURITY_GAMMA} maria_declare_plugin_end;
Loading