#this will start primary 
./setup-prim.sh
#this will start secondary and will do replication setup
./setup-sec.sh
sleep 10
#this will create schema, alter schema in secondary with storage=duckdb and populate sysbench tables with 8 table x 10 millioon rows
./prepare.sh
sleep 10
#This will generate load on primary with 48 threads, update-key with autocommit. Note, se
mariadb --socket=/secondary/data/mysql.sock -e "stop replica sql_thread;"
sleep 10
./run-key-txn.sh
sleep 30
/test-data/repl-build/mariadb-11.4.13-linux-x86_64/bin/mariadb --socket=/secondary/data/mysql.sock -e "SELECT run_in_duckdb('PRAGMA force_checkpoint');"
sleep 10
#./start-all-monitor.sh
#start sql_thread to start the 
mariadb --socket=/secondary/data/mysql.sock -e "shutdown; select sleep(10);"
sudo heaptrack /test-data/repl-build/mariadb-11.4.13-linux-x86_64/sbin/mariadbd --defaults-file=/test-data/repl-build/duckdb-sec.cnf --plugin-maturity=alpha --basedir=/test-data/repl-build/mariadb-11.4.13-linux-x86_64  --datadir=/secondary/data --plugin-dir=/test-data/repl-build/mariadb-11.4.13-linux-x86_64/lib/mysql/plugin --user=mysql --log-error=/secondary/data/hz-duckdb-bench.err --user=mysql --socket=/secondary/data/mysql.sock --port=3307 &
sleep 30

mariadb --socket=/secondary/data/mysql.sock -e "start replica sql_thread;"
sleep 120
mariadb --socket=/secondary/data/mysql.sock -e "shutdown;select sleep(10);"
mariadb --socket=/primary/data/mysql.sock -e "shutdown;select sleep(10);"


