Skip to content

Install update#56

Open
dvalinrh wants to merge 10 commits into
masterfrom
install_update
Open

Install update#56
dvalinrh wants to merge 10 commits into
masterfrom
install_update

Conversation

@dvalinrh

@dvalinrh dvalinrh commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

Update hammerdb installation process, including fixing mssql

Before/After Comparison

Before: We had to upload the kit for hammerdb, and we are running the wrong version of mssql
After: The wrapper now handles loading everything it needs, and runs the proper mssql version/

Clerical Stuff

This closes #55

Relates to JIRA: RPOPC-922

Testing:

Verified mariadb, mssql, and postgres all run properly.
mariadb csv file
connection,TPM,Start_Date,End_Date
10,148610,2026-05-05T16:51:32Z,2026-05-05T17:08:40Z
20,142877,2026-05-05T17:08:50Z,2026-05-05T17:25:58Z
40,134952,2026-05-05T17:26:08Z,2026-05-05T17:43:16Z

postgres csv file
connection,TPM,Start_Date,End_Date
10,191257,2026-05-06T11:38:22Z,2026-05-06T11:55:30Z
20,186956,2026-05-06T11:55:40Z,2026-05-06T12:12:48Z
40,180997,2026-05-06T12:12:58Z,2026-05-06T12:30:06Z

mssql csv file
connection,TPM,Start_Date,End_Date
10,209219,2026-05-07T01:24:16Z,2026-05-07T01:40:24Z
20,257094,2026-05-07T01:40:34Z,2026-05-07T01:56:47Z
40,272160,2026-05-07T01:56:57Z,2026-05-07T02:13:10Z

New version has also been used in doing hammerdb runs on AWS and azure regresssions.

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Update HammerDB installation and add comprehensive TPCC benchmark support for multiple databases

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Refactored HammerDB installation process to download from GitHub releases instead of requiring
  local kit uploads
• Fixed MSSQL installation to use RHEL 9 packages with dnf instead of yum
• Updated all hardcoded /usr/local/HammerDB paths to use configurable $hmd_dir variable for
  flexible deployment
• Removed upload parameter (-u) from installation scripts, simplifying the deployment workflow
• Added comprehensive TPCC benchmark scripts for MariaDB, PostgreSQL, MSSQL, and Oracle databases
• Implemented database build scripts with automatic configuration (buffer pools, tempdb
  optimization, traceflags)
• Added multi-host and multi-VM benchmark execution scripts for distributed testing across multiple
  database instances
• Created performance tuning configuration files for all supported databases (my.cnf,
  postgresql.conf, mssql.conf)
• Added extensive documentation for TPCC setup on RHEL 7/8, OpenShift, Podman containers, and
  persistent memory configurations
• Implemented statistics collection during benchmark runs (vmstat, iostat, system metrics)
• Added Oracle database support with initialization parameters, listener configuration, and
  startup/shutdown scripts
• Enhanced wrapper scripts to support local directory installations instead of system-wide paths
Diagram
flowchart LR
  A["Installation Script"] -->|Download from GitHub| B["HammerDB Binary"]
  A -->|Configure| C["MSSQL/MariaDB/PostgreSQL/Oracle"]
  B -->|Build Schema| D["TPCC Database"]
  D -->|Execute| E["Benchmark Tests"]
  E -->|Collect| F["Performance Metrics"]
  F -->|Generate| G["CSV Results"]
  H["Multi-Host Scripts"] -->|Distribute| I["Multiple DB Instances"]
  I -->|Parallel Execution| E
Loading

Grey Divider

File Changes

1. hammerdb/hammerdb_scripts/mssql/podman/update_temp.sh ✨ Enhancement +167/-0

MSSQL tempdb configuration script for podman environment

• New script that configures MSSQL tempdb by adding multiple data files
• Uses sqlcmd to execute ALTER DATABASE commands for tempdb optimization
• Removes and recreates tempdev files (tempdev2 through tempdev24) with 256MB size each
• Connects to MSSQL server using sa user with hardcoded password

hammerdb/hammerdb_scripts/mssql/podman/update_temp.sh


2. hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc_withstats.sh ✨ Enhancement +127/-0

MariaDB TPCC benchmark runner with statistics collection

• New script to run TPCC benchmark on MariaDB with performance statistics collection
• Collects system information (CPU, memory, kernel version) and database version
• Supports configurable user counts, warehouse counts, and storage types via command-line arguments
• Captures vmstat and iostat metrics during test execution and generates CSV results

hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc_withstats.sh


3. hammerdb/hammerdb_scripts/postgres/run_pg_tpcc_withstats.sh ✨ Enhancement +124/-0

PostgreSQL TPCC benchmark runner with statistics collection

• New script to run TPCC benchmark on PostgreSQL with performance metrics
• Collects system information and PostgreSQL version details
• Supports configurable parameters for users, warehouses, and storage types
• Generates CSV output with timing and TPM (transactions per minute) results

hammerdb/hammerdb_scripts/postgres/run_pg_tpcc_withstats.sh


View more (72)
4. hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh ✨ Enhancement +123/-0

MariaDB TPCC benchmark execution script

• New script to execute TPCC workload tests on MariaDB database
• Supports command-line parameters for user count, warehouse count, and storage type
• Restarts MariaDB before each user count run and collects performance metrics
• Generates benchmark results CSV with TPM values and system information

hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh


5. hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh ✨ Enhancement +122/-0

MSSQL TPCC benchmark runner with configuration

• New script to run TPCC benchmark on MSSQL with configurable parameters
• Calls mssql_settings.sh to configure database traceflags and performance settings
• Restarts MSSQL server and collects system metrics during test execution
• Generates CSV results with TPM values for different user counts

hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh


6. hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh ✨ Enhancement +121/-0

PostgreSQL TPCC benchmark execution script

• New script to execute TPCC workload on PostgreSQL with configurable parameters
• Restarts PostgreSQL before each user count run for consistent testing
• Collects vmstat and iostat metrics during benchmark execution
• Generates CSV output with performance results and system information

hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh


7. hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh ✨ Enhancement +96/-0

PostgreSQL TPCC database build script

• New script to build TPCC database schema on PostgreSQL
• Configures shared_buffers based on available system memory (up to 64GB)
• Drops existing tpcc database and role before building new schema
• Supports configurable warehouse count and user count parameters

hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh


8. hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh ✨ Enhancement +88/-0

MariaDB TPCC database build script

• New script to build TPCC database schema on MariaDB
• Configures innodb_buffer_pool_size based on available memory
• Restarts MariaDB service and drops existing tpcc database before build
• Supports configurable warehouse and user count parameters

hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh


9. hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb_ssh.sh ✨ Enhancement +78/-0

Multi-host MariaDB TPCC benchmark runner via SSH

• New script to run TPCC benchmark across multiple MariaDB hosts via SSH
• Executes tests with different user counts on multiple database instances in parallel
• Collects TPM results from each host and aggregates them
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb_ssh.sh


10. hammerdb/hammerdb_scripts/postgres/multi_db_run_pg_ssh.sh ✨ Enhancement +78/-0

Multi-host PostgreSQL TPCC benchmark runner via SSH

• New script to run TPCC benchmark across multiple PostgreSQL hosts via SSH
• Executes parallel tests with different user counts on multiple database instances
• Collects and displays TPM results from each host
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/postgres/multi_db_run_pg_ssh.sh


11. hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh ✨ Enhancement +81/-0

MSSQL TPCC database build script

• New script to build TPCC database schema on MSSQL
• Calls mssql_settings.sh to configure database traceflags
• Executes createdb_mssql.sh and update_temp.sh for database setup
• Supports configurable warehouse and user count parameters

hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh


12. hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb.sh ✨ Enhancement +62/-0

Multi-host MariaDB TPCC benchmark runner

• New script to run TPCC benchmark across multiple local MariaDB instances
• Executes tests with different user counts in parallel on multiple hosts
• Collects TPM results from each host and aggregates them
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb.sh


13. hammerdb/hammerdb_scripts/postgres/multi_db_build_pg_ssh.sh ✨ Enhancement +53/-0

Multi-host PostgreSQL TPCC database build via SSH

• New script to build TPCC database schema across multiple PostgreSQL hosts via SSH
• Drops existing tpcc database and role on each host before building
• Executes builds in parallel on multiple database instances
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/postgres/multi_db_build_pg_ssh.sh


14. hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb_ssh.sh ✨ Enhancement +49/-0

Multi-host MariaDB TPCC database build via SSH

• New script to build TPCC database schema across multiple MariaDB hosts via SSH
• Drops existing tpcc database on each host before building new schema
• Executes builds in parallel on multiple database instances
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb_ssh.sh


15. hammerdb/hammerdb_scripts/oracle/build_and_run_ora.sh ✨ Enhancement +42/-0

Oracle TPCC database build and benchmark runner

• New script to build and run TPCC benchmark on Oracle database
• Stops and starts Oracle instance with proper initialization
• Executes database creation and schema building via separate scripts
• Runs workload tests with different user counts and collects results

hammerdb/hammerdb_scripts/oracle/build_and_run_ora.sh


16. hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb.sh ✨ Enhancement +47/-0

Multi-host MariaDB TPCC database build

• New script to build TPCC database schema across multiple local MariaDB instances
• Drops existing tpcc database on each host before building
• Executes builds in parallel on multiple database instances
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb.sh


17. hammerdb/hammerdb_scripts/oracle/createdb_ora.sh ✨ Enhancement +33/-0

Oracle TPCC database creation script

• New script to create Oracle TPCC database with proper tablespaces and datafiles
• Creates system, sysaux, undo, and temporary tablespaces with large allocations
• Sets up bigfile tablespaces for TPCC data with autoextend capability
• Initializes database with specific control file and log file configurations

hammerdb/hammerdb_scripts/oracle/createdb_ora.sh


18. hammerdb/hammerdb_scripts/mssql/podman/createdb_mssql.sh ✨ Enhancement +34/-0

MSSQL TPCC database creation for podman

• New script to create MSSQL TPCC database in podman environment
• Drops existing tpcc database and creates new one with multiple data files
• Configures primary filegroup with 32GB initial size and log file with 20GB size
• Adds additional data files for performance optimization

hammerdb/hammerdb_scripts/mssql/podman/createdb_mssql.sh


19. hammerdb/hammerdb_scripts/mariadb/multi_vm_driver.sh ✨ Enhancement +44/-0

Multi-VM MariaDB benchmark distribution driver

• New script to distribute and execute HammerDB MariaDB workload across multiple VMs
• Uses SCP to copy benchmark script to remote hosts
• Executes benchmark script on each host via SSH with device specification
• Supports host specification via command-line arguments

hammerdb/hammerdb_scripts/mariadb/multi_vm_driver.sh


20. hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh ✨ Enhancement +36/-0

MSSQL TPCC database creation with mount point support

• New script to create MSSQL TPCC database with configurable mount point
• Accepts mount point parameter to place database files on specific storage
• Drops existing tpcc database and creates new one with specified file locations
• Adds additional data files for performance optimization

hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh


21. hammerdb/hammerdb_scripts/mssql/podman/build_mssql_tpcc.sh ✨ Enhancement +25/-0

MSSQL TPCC database build for podman

• New script to build MSSQL TPCC database schema in podman environment
• Executes update_temp.sh to configure tempdb files
• Calls createdb_mssql.sh to create database structure
• Runs HammerDB build script to create TPCC schema

hammerdb/hammerdb_scripts/mssql/podman/build_mssql_tpcc.sh


22. hammerdb/hammerdb_scripts/mssql/podman/mssql_settings.sh ⚙️ Configuration changes +24/-0

MSSQL performance configuration script for podman

• New script to configure MSSQL performance settings via mssql-conf
• Disables alternate write-through and write-through control parameters
• Disables memory pressure to allow full memory utilization
• Enables multiple traceflags (652, 823, 834, 880, 1224, 1613, 2330, 3468, 3979, 7413, 8040, 8077,
 8088, 8744) for performance optimization

hammerdb/hammerdb_scripts/mssql/podman/mssql_settings.sh


23. hammerdb/hammerdb_scripts/mssql/mssql_settings.sh ⚙️ Configuration changes +24/-0

MSSQL performance configuration script

• New script to configure MSSQL performance settings via mssql-conf
• Disables alternate write-through and write-through control parameters
• Disables memory pressure to allow full memory utilization
• Enables multiple traceflags for performance optimization

hammerdb/hammerdb_scripts/mssql/mssql_settings.sh


24. hammerdb/hammerdb_scripts/mssql/update_temp_mnt.sh ✨ Enhancement +37/-0

MSSQL tempdb configuration with mount point support

• New script to configure MSSQL tempdb with configurable mount point
• Accepts mount point parameter to place tempdb files on specific storage
• Dynamically creates tempdb files based on CPU count (8-32 CPUs)
• Removes and recreates tempdev files with proper sizing

hammerdb/hammerdb_scripts/mssql/update_temp_mnt.sh


25. hammerdb/hammerdb_scripts/oracle/createddviews.sh ✨ Enhancement +38/-0

Oracle database views and catalog creation

• New script to create Oracle database views and catalog objects
• Executes standard Oracle admin scripts (standard.sql, dbmsstdx, catalog, catproc)
• Runs pupbld script for additional database setup
• Generates log file for tracking execution

hammerdb/hammerdb_scripts/oracle/createddviews.sh


26. hammerdb/hammerdb_scripts/mssql/createdb_mssql.sh ✨ Enhancement +25/-0

MSSQL TPCC database creation script

• New script to create MSSQL TPCC database with files on /perf1 mount point
• Drops existing tpcc database and creates new one with multiple data files
• Configures primary filegroup with 32GB initial size and log file with 20GB size
• Adds additional data files for performance optimization

hammerdb/hammerdb_scripts/mssql/createdb_mssql.sh


27. hammerdb/hammerdb_scripts/postgres/multi_db_run_pg.sh ✨ Enhancement +20/-0

PostgreSQL TPCC benchmark runner for local instance

• New script to run TPCC benchmark on local PostgreSQL instance with multiple test configurations
• Executes tests with different user counts in parallel
• Copies and modifies test configuration files for each run
• Collects output files for each test execution

hammerdb/hammerdb_scripts/postgres/multi_db_run_pg.sh


28. hammerdb/hammerdb_scripts/mssql/update_temp.sh ✨ Enhancement +20/-0

MSSQL tempdb configuration script

• New script to configure MSSQL tempdb files based on CPU count
• Dynamically creates tempdb files (8-32 depending on CPU count)
• Removes and recreates tempdev files with proper sizing on /perf1 mount point
• Uses sqlcmd to execute ALTER DATABASE commands

hammerdb/hammerdb_scripts/mssql/update_temp.sh


29. hammerdb/hammerdb_scripts/postgres/multi_db_build_pg.sh ✨ Enhancement +14/-0

PostgreSQL TPCC database build for local instance

• New script to build TPCC database schema on local PostgreSQL instance
• Drops existing tpcc database and role before building
• Copies and modifies build configuration files for each run
• Executes HammerDB build script in background

hammerdb/hammerdb_scripts/postgres/multi_db_build_pg.sh


30. hammerdb/hammerdb_scripts/postgres/multi_db_build.sh ✨ Enhancement +14/-0

PostgreSQL TPCC database build script

• New script to build TPCC database schema on local PostgreSQL instance
• Drops existing tpcc database and role before building
• Copies and modifies build configuration files
• Executes HammerDB build script in background

hammerdb/hammerdb_scripts/postgres/multi_db_build.sh


31. hammerdb/hammerdb_scripts/oracle/build_db.sh ✨ Enhancement +19/-0

Oracle TPCC database creation script

• New script to create Oracle TPCC database with specific file allocations
• Uses sqlcmd (MSSQL tool) which appears to be incorrect for Oracle
• Creates database with 87GB primary datafile and 20GB log file
• Configures file growth parameters for scalability

hammerdb/hammerdb_scripts/oracle/build_db.sh


32. hammerdb/hammerdb_scripts/postgres/drop_pg.sh ✨ Enhancement +7/-0

PostgreSQL TPCC database cleanup script

• New script to drop TPCC database and role from PostgreSQL
• Sets library path for MySQL compatibility
• Executes DROP DATABASE and DROP ROLE commands via psql

hammerdb/hammerdb_scripts/postgres/drop_pg.sh


33. hammerdb/hammerdb_scripts/mssql/copy_files_to_pbench.sh ✨ Enhancement +2/-0

MSSQL results file copy utility

• New script to copy MSSQL configuration and results files to benchmark results directory
• Copies mssql.conf configuration file
• Copies CSV results file with TPM metrics

hammerdb/hammerdb_scripts/mssql/copy_files_to_pbench.sh


34. hammerdb/hammerdb_scripts/mariadb/run_mariadb.sh ✨ Enhancement +6/-0

MariaDB TPCC test execution wrapper

• New script to execute MariaDB TPCC test via HammerDB CLI
• Sources runtest_mariadb.tcl configuration file
• Provides simple wrapper for running benchmark

hammerdb/hammerdb_scripts/mariadb/run_mariadb.sh


35. hammerdb/hammerdb_scripts/oracle/buildora.sh ✨ Enhancement +6/-0

Oracle TPCC schema build wrapper

• New script to build Oracle TPCC schema via HammerDB CLI
• Sources buildora.tcl configuration file
• Provides wrapper for schema building process

hammerdb/hammerdb_scripts/oracle/buildora.sh


36. hammerdb/hammerdb_scripts/mssql/podman/.Readme_tpcc_mssql.swp 📝 Documentation +0/-0

MSSQL TPCC podman setup documentation (swap file)

• Vim swap file containing documentation for MSSQL TPCC setup in podman environment
• Contains detailed instructions for podman image setup, database configuration, and benchmark
 execution
• Includes configuration parameters, traceflags, and troubleshooting information

hammerdb/hammerdb_scripts/mssql/podman/.Readme_tpcc_mssql.swp


37. hammerdb/hammerdb ✨ Enhancement +12/-16

HammerDB wrapper script directory and installation handling

• Modified main HammerDB wrapper script to use local directory instead of /usr/local
• Added script_dir and hmd_dir variables to manage HammerDB installation directory
• Changed working directory from /usr/local to $hmd_dir for test execution
• Updated file handling to work with local directory structure instead of system-wide installation
• Changed grep pattern from egrep to grep -E for better compatibility

hammerdb/hammerdb


38. hammerdb/hammerdb_scripts/mssql/runtest_mssql.tcl ✨ Enhancement +28/-0

MSSQL TPCC benchmark configuration script

• New TCL script to configure and execute MSSQL TPCC benchmark via HammerDB
• Sets database to MSSQL and benchmark to TPC-C
• Configures connection parameters (server, password) and test parameters (warehouse count, user
 count, duration)
• Loads script, sets virtual users, and runs benchmark with completion wait

hammerdb/hammerdb_scripts/mssql/runtest_mssql.tcl


39. hammerdb/run_hammerdb ✨ Enhancement +35/-35

Refactor HammerDB paths to use configurable directory variable

• Removed hardcoded /usr/local/HammerDB paths and replaced with $hmd_dir variable for
 flexibility
• Removed -u upload parameter and associated /${to_home_root}/${to_user}/uploads path from
 install-script calls
• Removed background execution (&) from remote SSH install-script invocations
• Updated all hammerdbcli command references to use ${hmd_dir}/hammerdbcli for proper path
 resolution

hammerdb/run_hammerdb


40. hammerdb/install-script ✨ Enhancement +31/-23

Update installation to download HammerDB and use configurable paths

• Updated MSSQL installation to use RHEL 9 packages and dnf instead of yum
• Changed from local tar extraction to downloading HammerDB installer directly from GitHub releases
• Replaced hardcoded /usr/local/HammerDB with $hmd_dir variable throughout
• Removed -u uploads parameter and updated script file sourcing to use
 ${script_dir}/hammerdb_scripts/ paths
• Updated package_tool call to remove ${TOOLS_BIN}/ prefix

hammerdb/install-script


41. hammerdb/hammerdb_scripts/oracle/db.rsp ⚙️ Configuration changes +354/-0

Add Oracle database installation response file

• New Oracle database response file for automated installation configuration
• Contains Oracle 19.0.0 installation parameters including edition, paths, and database settings
• Specifies software-only installation mode with manual root script execution

hammerdb/hammerdb_scripts/oracle/db.rsp


42. hammerdb/hammerdb_scripts/mssql/Openshift/Readme_tpcc_mssql 📝 Documentation +203/-0

Add MSSQL TPCC OpenShift setup documentation

• New comprehensive documentation for MSSQL TPCC setup on OpenShift
• Includes installation steps for MSSQL server, Microsoft tools, and HammerDB
• Provides configuration instructions for traceflags, tempdb setup, and test execution

hammerdb/hammerdb_scripts/mssql/Openshift/Readme_tpcc_mssql


43. hammerdb/hammerdb_scripts/mssql/Readme_tpcc_mssql 📝 Documentation +203/-0

Add MSSQL TPCC setup documentation

• New comprehensive documentation for MSSQL TPCC setup
• Includes installation steps for MSSQL server, Microsoft tools, and HammerDB
• Provides configuration instructions for traceflags, tempdb setup, and test execution

hammerdb/hammerdb_scripts/mssql/Readme_tpcc_mssql


44. hammerdb/hammerdb_scripts/mssql/input ⚙️ Configuration changes +169/-0

Add MSSQL tempdb multi-file configuration script

• New SQL script for configuring MSSQL tempdb with multiple data files
• Adds 24 tempdb files for performance optimization across multiple storage locations

hammerdb/hammerdb_scripts/mssql/input


45. hammerdb/hammerdb_scripts/postgres/Readme_pg 📝 Documentation +174/-0

Add PostgreSQL TPCC setup documentation

• New comprehensive documentation for PostgreSQL TPCC setup
• Includes installation steps for PostgreSQL, HammerDB, and database initialization
• Provides configuration instructions for schema building and workload execution

hammerdb/hammerdb_scripts/postgres/Readme_pg


46. hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel7 📝 Documentation +153/-0

Add MariaDB TPCC RHEL 7 setup documentation

• New comprehensive documentation for MariaDB TPCC setup on RHEL 7
• Includes installation steps for MariaDB, HammerDB, and database configuration
• Provides instructions for schema building and workload execution

hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel7


47. hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel8 📝 Documentation +126/-0

Add MariaDB TPCC RHEL 8 setup documentation

• New comprehensive documentation for MariaDB TPCC setup on RHEL 8
• Includes installation steps using dnf package manager for RHEL 8
• Provides instructions for schema building and workload execution with pbench integration

hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel8


48. hammerdb/hammerdb_scripts/mssql/podman/Readme_tpcc_mssql 📝 Documentation +100/-0

Add MSSQL TPCC Podman container setup documentation

• New documentation for running MSSQL TPCC in Podman containers
• Includes container image setup, mount configuration, and HammerDB integration
• Provides instructions for schema building and workload execution in containerized environment

hammerdb/hammerdb_scripts/mssql/podman/Readme_tpcc_mssql


49. hammerdb/hammerdb_scripts/postgres/postgresql.conf ⚙️ Configuration changes +33/-0

Add PostgreSQL performance tuning configuration

• New PostgreSQL configuration file with performance tuning parameters
• Configures connection limits, memory buffers, and WAL settings for TPCC workload

hammerdb/hammerdb_scripts/postgres/postgresql.conf


50. hammerdb/hammerdb_scripts/mariadb/my.cnf ⚙️ Configuration changes +69/-0

Add MariaDB performance tuning configuration

• New MariaDB configuration file with performance tuning parameters
• Configures InnoDB buffer pool, log files, and thread settings for TPCC workload

hammerdb/hammerdb_scripts/mariadb/my.cnf


51. hammerdb/hammerdb_scripts/oracle/Readme_tpcc_ora 📝 Documentation +40/-0

Add Oracle TPCC setup documentation

• New documentation for Oracle TPCC setup
• Includes installation steps for Oracle and HammerDB integration
• Provides instructions for database creation and schema building

hammerdb/hammerdb_scripts/oracle/Readme_tpcc_ora


52. hammerdb/hammerdb_scripts/mssql/pmem_config_options 📝 Documentation +33/-0

Add MSSQL persistent memory configuration guide

• New configuration guide for MSSQL with persistent memory (pmem) devices
• Includes mssql.conf settings and XFS filesystem mount options for DAX mode

hammerdb/hammerdb_scripts/mssql/pmem_config_options


53. hammerdb/hammerdb_scripts/mariadb/runtest_mariadb.tcl ⚙️ Configuration changes +28/-0

Add MariaDB TPCC test execution script

• New TCL script for running MariaDB TPCC tests
• Configures database connection, warehouse count, and test parameters

hammerdb/hammerdb_scripts/mariadb/runtest_mariadb.tcl


54. hammerdb/hammerdb_scripts/oracle/p_run.ora ⚙️ Configuration changes +22/-0

Add Oracle runtime initialization parameters

• New Oracle initialization parameter file for runtime configuration
• Specifies SGA target, process limits, and I/O optimization settings

hammerdb/hammerdb_scripts/oracle/p_run.ora


55. hammerdb/hammerdb_scripts/postgres/runtest_pg.tcl ⚙️ Configuration changes +28/-0

Add PostgreSQL TPCC test execution script

• New TCL script for running PostgreSQL TPCC tests
• Configures database connection, warehouse count, and test parameters

hammerdb/hammerdb_scripts/postgres/runtest_pg.tcl


56. hammerdb/hammerdb_scripts/mariadb/build_mariadb.tcl ⚙️ Configuration changes +25/-0

Add MariaDB TPCC schema build script

• New TCL script for building MariaDB TPCC schema
• Configures database connection, warehouse count, and schema build parameters

hammerdb/hammerdb_scripts/mariadb/build_mariadb.tcl


57. hammerdb/hammerdb_scripts/oracle/runtest_oracle.tcl ⚙️ Configuration changes +28/-0

Add Oracle TPCC test execution script

• New TCL script for running Oracle TPCC tests
• Configures database connection, warehouse count, and test parameters

hammerdb/hammerdb_scripts/oracle/runtest_oracle.tcl


58. hammerdb/hammerdb_scripts/mssql/podman/mssql.conf ⚙️ Configuration changes +22/-0

Add MSSQL Podman container configuration

• New MSSQL configuration file for Podman container deployment
• Specifies traceflags and performance tuning parameters for containerized MSSQL

hammerdb/hammerdb_scripts/mssql/podman/mssql.conf


59. hammerdb/hammerdb_scripts/mssql/mssql.conf ⚙️ Configuration changes +22/-0

Add MSSQL performance tuning configuration

• New MSSQL configuration file with performance tuning traceflags
• Specifies write-through settings and various performance optimization flags

hammerdb/hammerdb_scripts/mssql/mssql.conf


60. hammerdb/hammerdb_scripts/mssql/build_mssql.tcl ⚙️ Configuration changes +23/-0

Add MSSQL TPCC schema build script

• New TCL script for building MSSQL TPCC schema
• Configures database connection, warehouse count, and schema build parameters

hammerdb/hammerdb_scripts/mssql/build_mssql.tcl


61. hammerdb/hammerdb_scripts/oracle/p_create.ora ⚙️ Configuration changes +18/-0

Add Oracle database creation initialization parameters

• New Oracle initialization parameter file for database creation
• Specifies SGA target, undo management, and I/O optimization settings

hammerdb/hammerdb_scripts/oracle/p_create.ora


62. hammerdb/hammerdb_scripts/postgres/build_pg.tcl ⚙️ Configuration changes +22/-0

Add PostgreSQL TPCC schema build script

• New TCL script for building PostgreSQL TPCC schema
• Configures database connection, warehouse count, and schema build parameters

hammerdb/hammerdb_scripts/postgres/build_pg.tcl


63. hammerdb/hammerdb_scripts/mssql/podman/build_mssql.tcl ⚙️ Configuration changes +22/-0

Add MSSQL Podman TPCC schema build script

• New TCL script for building MSSQL TPCC schema in Podman containers
• Configures database connection, warehouse count, and schema build parameters

hammerdb/hammerdb_scripts/mssql/podman/build_mssql.tcl


64. hammerdb/hammerdb_scripts/oracle/listener.ora ⚙️ Configuration changes +19/-0

Add Oracle listener configuration

• New Oracle listener configuration file
• Specifies IPC and TCP connection protocols for TPCC database

hammerdb/hammerdb_scripts/oracle/listener.ora


65. hammerdb/hammerdb_scripts/oracle/bash_profile ⚙️ Configuration changes +9/-0

Add Oracle user environment configuration

• New bash profile for Oracle user environment setup
• Configures ORACLE_HOME, ORACLE_SID, and library paths

hammerdb/hammerdb_scripts/oracle/bash_profile


66. hammerdb/hammerdb_scripts/oracle/build_oracle.tcl ⚙️ Configuration changes +17/-0

Add Oracle TPCC schema build script

• New TCL script for building Oracle TPCC schema
• Configures database connection, warehouse count, and schema build parameters

hammerdb/hammerdb_scripts/oracle/build_oracle.tcl


67. hammerdb/hammerdb_scripts/mssql/mssql-repo-2019.repo ⚙️ Configuration changes +6/-0

Add MSSQL Server 2019 repository configuration

• New YUM repository configuration for MSSQL Server 2019
• Specifies Microsoft package repository for RHEL 8

hammerdb/hammerdb_scripts/mssql/mssql-repo-2019.repo


68. hammerdb/hammerdb_scripts/mssql/mssql-repo-2017.repo ⚙️ Configuration changes +7/-0

Add MSSQL Server 2017 repository configuration

• New YUM repository configuration for MSSQL Server 2017
• Specifies Microsoft package repository for RHEL 7

hammerdb/hammerdb_scripts/mssql/mssql-repo-2017.repo


69. hammerdb/hammerdb_mssql.json ⚙️ Configuration changes +15/-0

Add MSSQL package dependency configuration

• New package dependency configuration for MSSQL HammerDB setup
• Specifies RHEL and Python package dependencies

hammerdb/hammerdb_mssql.json


70. hammerdb/hammerdb_scripts/oracle/tnsnames.ora ⚙️ Configuration changes +9/-0

Add Oracle TNS names configuration

• New Oracle TNS names configuration file
• Specifies TCP connection details for TPCC database service

hammerdb/hammerdb_scripts/oracle/tnsnames.ora


71. hammerdb/hammerdb_scripts/postgres/pg_hba.conf ⚙️ Configuration changes +5/-0

Add PostgreSQL authentication configuration

• New PostgreSQL host-based authentication configuration
• Allows local and network connections with trust authentication

hammerdb/hammerdb_scripts/postgres/pg_hba.conf


72. hammerdb/hammerdb.json Dependencies +1/-0

Add wget package dependency

• Added wget to the list of required system packages

hammerdb/hammerdb.json


73. hammerdb/hammerdb_scripts/oracle/startdb ⚙️ Configuration changes +6/-0

Add Oracle database startup script

• New script to start Oracle database instance
• Sources bash profile and executes startup command

hammerdb/hammerdb_scripts/oracle/startdb


74. hammerdb/hammerdb_scripts/oracle/shutdb ⚙️ Configuration changes +6/-0

Add Oracle database shutdown script

• New script to shutdown Oracle database instance
• Sources bash profile and executes immediate shutdown command

hammerdb/hammerdb_scripts/oracle/shutdb


75. hammerdb/hammerdb_scripts/mariadb/libmysqlclient.so.20 Additional files +0/-0

...

hammerdb/hammerdb_scripts/mariadb/libmysqlclient.so.20


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 5, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Broken remote install command ✓ Resolved 🐞 Bug ≡ Correctness
Description
In hammerdb/run_hammerdb:install_it(), the ssh command strings are unterminated (missing closing
quote), causing a shell syntax error and preventing any remote (multi-host) installs from running.
Code

hammerdb/run_hammerdb[R96-99]

+				ssh root@${hostnm} "./install-script -d ${disklist} -t $1 ${log_mount_point}
  		else
-				ssh root@${hostnm} "./install-script -m ${mountpoint} -t $1 ${log_mount_point} -u /${to_home_root}/${to_user}/uploads" & 
+				ssh root@${hostnm} "./install-script -m ${mountpoint} -t $1 ${log_mount_point}
  		fi
Evidence
The remote install path uses ssh with a quoted command, but the quotes are never closed, making the
script syntactically invalid when that branch executes.

hammerdb/run_hammerdb[87-101]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`install_it()` in `hammerdb/run_hammerdb` has two `ssh ... "./install-script ...` lines that are missing the closing `"`, which makes the script fail to parse/execute for remote installs.
### Issue Context
This regression was introduced when removing the `-u` uploads argument and updating the install command.
### Fix Focus Areas
- hammerdb/run_hammerdb[91-102]
### Suggested fix
- Restore proper quoting, e.g.:
- `ssh root@${hostnm} "./install-script -d ${disklist} -t $1 ${log_mount_point}" &`
- `ssh root@${hostnm} "./install-script -m ${mountpoint} -t $1 ${log_mount_point}" &`
- Keep the `&` + `wait` behavior (or remove both consistently) so remote hosts install in parallel as intended.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Unverified root installer download 🐞 Bug ⛨ Security
Description
hammerdb/install-script downloads the HammerDB installer via wget and executes it as root without
any checksum/signature verification, enabling supply-chain or MITM-based code execution.
Code

hammerdb/install-script[R273-285]

+mkdir -p $hmd_dir
+pushd  $hmd_dir > /dev/null
+echo install HammerDB-3.2-Linux-x86-64-Install
+wget https://github.com/TPC-Council/HammerDB/releases/download/v3.2/HammerDB-3.2-Linux-x86-64-Install
+if [[ $? -ne 0 ]]; then
+	echo Error: Failed to install HammerDB-3.2-Linux-x86-64-Install
+	exit 1
+fi
+chmod 755 HammerDB-3.2-Linux-x86-64-Install
+echo HammerDB-3.2-Linux-x86-64-Install installed.
echo "y" > input
-echo "/usr/local/HammerDB" >> input
-./HammerDB-3.2-Linux-x86-64-Install < input
+echo "$hmd_dir" >> input 
+${hmd_dir}/HammerDB-3.2-Linux-x86-64-Install < input
Evidence
The script pulls an executable from a remote URL and runs it directly, with no integrity
verification step before execution.

hammerdb/install-script[273-285]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`hammerdb/install-script` downloads and executes the HammerDB installer as root without verifying integrity. This is a direct remote code execution vector if the binary or download path is compromised.
### Issue Context
The PR intentionally moved away from uploading a tarball and now bootstraps from GitHub releases.
### Fix Focus Areas
- hammerdb/install-script[273-286]
### Suggested fix
- Pin and verify the downloaded artifact before executing, e.g.:
- Download a published checksum file and verify via `sha256sum -c`.
- Or embed an expected SHA256 for the exact version and validate it.
- Fail fast on mismatch (`exit 1`).
- Consider downloading to a temp file and only moving into place after verification.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Invalid dnf mssql-tools command ✓ Resolved 🐞 Bug ☼ Reliability
Description
hammerdb/install-script uses dnf -y mssql-tools (missing the install subcommand), so that step
fails and the script continues without detecting the error, risking incomplete MSSQL tool
installation.
Code

hammerdb/install-script[R37-43]

+	dnf -y install mssql-server
+	dnf -y mssql-tools
+#	curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo
+	echo done installing mssql-server/mssql-tools
+#	yum -y remove unixODBC-utf16 unixODBC-utf16-devel
  ACCEPT_EULA=Y yum install -y mssql-tools unixODBC-devel
  echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
-	cd /usr/local/HammerDB
-	cp -R  /tmp/hammerdb-tpcc/mssql/* .
Evidence
The MSSQL install path includes a malformed dnf invocation and the script does not use set -e or
check return codes for these commands, so failures can go unnoticed.

hammerdb/install-script[30-45]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The MSSQL install function contains `dnf -y mssql-tools`, which is not a valid `dnf` command form (it should be `dnf ... install <pkg>`). Because the script doesn't fail fast, the installation can proceed in a partially broken state.
### Issue Context
There is also a later `yum install -y mssql-tools ...` line, so the current state looks like accidental duplication rather than intentional fallback.
### Fix Focus Areas
- hammerdb/install-script[30-43]
### Suggested fix
- Replace with `dnf -y install mssql-tools` (or remove the redundant line if the yum/dnf install below is the intended path).
- Prefer one package manager consistently.
- Add `set -euo pipefail` at the top of the script or explicitly check return codes for install steps.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Wrong variable exported ✓ Resolved 🐞 Bug ☼ Reliability
Description
hammerdb/hammerdb now exports to_pkg_tool_flags, but the codebase still uses to_no_pkg_install
for the --no_packages argument; child scripts like install-script can lose the intended
to_no_pkg_install value.
Code

hammerdb/hammerdb[R134-137]

${TOOLS_BIN}/gather_data ${curdir}
source ${TOOLS_BIN}/general_setup "$@"
-export to_no_pkg_install
+export to_pkg_tool_flags
+
Evidence
hammerdb/hammerdb exports only to_pkg_tool_flags, while install-script and hammerdb/hammerdb
still reference $to_no_pkg_install. Since run_hammerdb/install-script are executed as separate
processes, missing exports can change behavior or break argument parsing.

hammerdb/hammerdb[134-137]
hammerdb/hammerdb[281-286]
hammerdb/install-script[89-96]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The wrapper exports `to_pkg_tool_flags`, but the scripts still use `to_no_pkg_install` for `--no_packages`. This can cause child processes (run via `./run_this` / ssh) to not receive the intended `to_no_pkg_install` value.
### Issue Context
`to_pkg_tool_flags` is not referenced anywhere else in this repo, while `to_no_pkg_install` is referenced in both `hammerdb/hammerdb` and `install-script`.
### Fix Focus Areas
- hammerdb/hammerdb[134-137]
- hammerdb/install-script[89-96]
### Suggested fix
- Revert to exporting `to_no_pkg_install` (or ensure `general_setup` exports it and keep the name consistent everywhere).
- If the intent is to rename, update all usages (`--no_packages`) to use the new variable consistently.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Committed Vim swap file 🐞 Bug ⚙ Maintainability
Description
A Vim swap file (.swp) is added to the repo, which is binary noise and embeds local host/user/path
strings that should not be committed.
Code

hammerdb/hammerdb_scripts/mssql/podman/.Readme_tpcc_mssql.swp[R1-2]

+b0VIM 8.0��������a]^e�j�{���root������������������������������������woody.perf.lab.eng.bos.redhat.com�������/shak/HammerDB/tpcc/mssql/podman/Readme_tpcc_mssql���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������utf-8
+�3210����#"! ��U�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������tp��������������
Evidence
The PR adds a file with a Vim swap header and embedded machine/path strings, indicating an editor
artifact was committed.

pr_files_diffs/hammerdb_hammerdb_scripts_mssql_podman__Readme_tpcc_mssql_swp.patch[1-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A `.swp` file (Vim swap) was committed under `hammerdb/hammerdb_scripts/mssql/podman/`. This should not be versioned.
### Issue Context
The diff content shows a `VIM` swap header and embedded local hostname/path strings.
### Fix Focus Areas
- hammerdb/hammerdb_scripts/mssql/podman/.Readme_tpcc_mssql.swp[1-2]
### Suggested fix
- Delete the `.swp` file from the repo.
- Add an ignore rule (e.g. `*.swp`, `.*.swp`) to prevent recurrence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread hammerdb/run_hammerdb Outdated
Comment thread hammerdb/install-script
@dvalinrh dvalinrh requested a review from frival May 7, 2026 09:02
@dvalinrh

dvalinrh commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Qodo: Unverified root installer download, this has always been there, not worried about it.

vim file removed.

Comment thread hammerdb/hammerdb_scripts/mariadb/libmysqlclient.so.20
Comment thread hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/multi_db_build_mariadb_ssh.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/multi_db_run_mariadb_ssh.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/multi_vm_driver.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/my.cnf
Comment thread hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel7 Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/Readme_mariadb_rhel8 Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/run_mariadb.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh
Comment thread hammerdb/hammerdb_scripts/mssql/Openshift/Readme_tpcc_mssql Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/podman/build_mssql.tcl Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/build_mssql.tcl Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/input Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/pmem_config_options Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/Readme_tpcc_mssql Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/update_temp_mnt.sh Outdated
Comment thread hammerdb/hammerdb_scripts/oracle/bash_profile Outdated
Comment thread hammerdb/hammerdb_scripts/postgres/drop_pg.sh Outdated
Comment thread hammerdb/hammerdb_scripts/postgres/Readme_pg Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh
Comment thread hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh
Comment thread hammerdb/install-script
Comment thread hammerdb/install-script Outdated
Comment thread hammerdb/install-script Outdated
Comment thread hammerdb/install-script Outdated
Comment thread hammerdb/run_hammerdb Outdated
Comment thread hammerdb/run_hammerdb Outdated
Comment thread hammerdb/run_hammerdb Outdated
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 8f60e71a-cf81-4806-b4f5-054305b3b5f2

📥 Commits

Reviewing files that changed from the base of the PR and between 28b5d55 and be9d2cd.

📒 Files selected for processing (1)
  • hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added automated TPCC benchmark runners for MariaDB, MSSQL, and PostgreSQL with per-user iteration, result collection, and CSV reporting.
    • Added database-specific runtime/configuration scripts to streamline builds and runs.
  • Chores

    • Installer now uses a dedicated HammerDB install directory and downloads HammerDB from releases.
    • Added wget to RHEL dependency list and improved results packaging/collection.

Walkthrough

Refactors HammerDB installation to use a script-local hmd_dir and direct GitHub installer download, standardizes install/run orchestration to use hmd_dir, and adds TPCC configuration, build, and run automation for MariaDB, MSSQL, and PostgreSQL including server configs, Tcl scripts, and shell runners.

Changes

HammerDB wrapper install and workload flows

Layer / File(s) Summary
Script location, HammerDB install directory, and direct download
hammerdb/hammerdb, hammerdb/hammerdb.json, hammerdb/install-script
The wrapper determines its own location (script_dir), creates an install subdirectory (hmd_dir), exports both variables (and to_pkg_tool_flags), adds wget dependency, and downloads HammerDB 3.2 directly from GitHub releases instead of extracting from uploaded tarballs.
Install and run script updates to use hmd_dir
hammerdb/install-script, hammerdb/run_hammerdb
Install and run orchestration removes the -u uploads argument, copies database scripts from script_dir/hammerdb_scripts/ into hmd_dir, updates MSSQL SA password and working directories, adjusts package_tool invocation, and switches build/run paths to ${hmd_dir}/hammerdbcli with updated output file naming and post-run tarball creation.
MariaDB TPCC configuration and benchmark automation
hammerdb/hammerdb_scripts/mariadb/my.cnf, hammerdb/hammerdb_scripts/mariadb/build_mariadb.tcl, hammerdb/hammerdb_scripts/mariadb/runtest_mariadb.tcl, hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh
Adds MariaDB server tuning, HammerDB build/run Tcl scripts with completion polling, and shell orchestration for service control, dynamic config edits, workload loops, TPM extraction, CSV result generation, and artifact collection.
MSSQL TPCC dependencies, setup, build, and run scripts
hammerdb/hammerdb_mssql.json, hammerdb/hammerdb_scripts/mssql/mssql.conf, hammerdb/hammerdb_scripts/mssql/mssql_settings.sh, hammerdb/hammerdb_scripts/mssql/createdb_mssql.sh, hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh, hammerdb/hammerdb_scripts/mssql/update_temp.sh, hammerdb/hammerdb_scripts/mssql/build_mssql.tcl, hammerdb/hammerdb_scripts/mssql/runtest_mssql.tcl, hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh
Adds MSSQL dependency manifest, server configuration and settings scripts, DB creation utilities (including mountpoint variant), tempdb update script, HammerDB build/run Tcl scripts, and a run automation script for service lifecycle, parameter injection, workload execution, metric parsing, and results collection.
PostgreSQL TPCC configuration and benchmark automation
hammerdb/hammerdb_scripts/postgres/postgresql.conf, hammerdb/hammerdb_scripts/postgres/pg_hba.conf, hammerdb/hammerdb_scripts/postgres/build_pg.tcl, hammerdb/hammerdb_scripts/postgres/runtest_pg.tcl, hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh
Adds PostgreSQL server configuration, HammerDB build/run Tcl scripts with completion polling, and shell orchestration for metadata collection, service control, parameter editing, workload execution loops, TPM parsing, and CSV result generation.

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive Title 'Install update' is vague and generic, describing a broad category of changes without clearly indicating the specific primary change (HammerDB installation refactoring). Use a more descriptive title like 'Refactor HammerDB installation to download directly and remove upload requirement' to clearly convey the main change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed Description covers main objectives, before/after behavior, related issue/JIRA ticket, and includes testing verification with concrete CSV output results.
Linked Issues check ✅ Passed All coding requirements from issue #55 are met: HammerDB now downloads MSSQL kit directly and no longer requires uploading a tarball; wrapper handles loading all components automatically.
Out of Scope Changes check ✅ Passed All changes directly support the two core objectives: refactoring installation to download HammerDB and MSSQL components dynamically, and eliminating the tarball upload requirement. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

♻️ Duplicate comments (6)
hammerdb/hammerdb_scripts/mariadb/my.cnf (1)

4-4: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Hardcoded datadir may not exist on target systems.

The datadir /perf1/mysql/data is hardcoded and may not exist on all benchmark target systems, causing MariaDB startup failures.

Consider documenting this path requirement in setup instructions or making it configurable via the build script.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mariadb/my.cnf` at line 4, The my.cnf currently
hardcodes datadir=/perf1/mysql/data which can cause startup failures if that
path doesn't exist; update the deployment to make the datadir configurable
instead of hardcoded by reading it from an environment variable or build-time
config and substituting it into the my.cnf, or document the required path in the
setup instructions; specifically modify the configuration generation step (the
code that writes/installs my.cnf) to replace the literal
"datadir=/perf1/mysql/data" with a templated value sourced from the build script
or env var and add validation to ensure the target directory exists before
starting MariaDB.
hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh (1)

17-17: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Copy/paste error: wrong script name in usage.

The usage text references run_mssql_tpcc.sh but this file is run_mariadb_tpcc.sh. This will confuse users trying to understand or use the script.

📝 Proposed fix
-        run_mssql_tpcc.sh [-h] [-u users] [-t runlength] [-w warehouse count] [-s storage type]
+        run_mariadb_tpcc.sh [-h] [-u users] [-t runlength] [-w warehouse count] [-s storage type]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh` at line 17, Update the
usage string in the script's help/usage output where it currently says
"run_mssql_tpcc.sh ..." to the correct script name "run_mariadb_tpcc.sh" so the
usage line accurately reflects this file; locate and edit the usage/USAGE
variable or echo statement in run_mariadb_tpcc.sh that prints the usage help and
replace the incorrect script name.
hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh (1)

77-78: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace fixed sleep with readiness check.

The 30-second sleep after starting PostgreSQL may either waste time (if service is ready sooner) or fail to wait long enough (if startup is slow). Use a readiness polling loop instead.

🔄 Suggested readiness check pattern
 systemctl start postgresql
-sleep 30
+# Wait for PostgreSQL to be ready
+for i in {1..30}; do
+  if psql -U postgres -d postgres -c "SELECT 1" &>/dev/null; then
+    break
+  fi
+  sleep 1
+done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh` around lines 77 - 78,
Replace the fixed "sleep 30" after "systemctl start postgresql" with a readiness
polling loop that checks service readiness (e.g., using "systemctl is-active
postgresql" and/or "pg_isready") until successful or a short timeout is reached;
if the check fails before the timeout, emit an error and exit non‑zero. Update
the script around the "systemctl start postgresql" call to repeatedly poll at
short intervals (e.g., 1s) and break when the service is active/pg_isready
returns OK, otherwise fail after the timeout.
hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh (1)

100-101: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace fixed sleep with readiness check.

The 30-second sleep after restarting PostgreSQL may either waste time or fail to wait long enough. Use a readiness polling loop to verify the service is accepting connections before proceeding.

🔄 Suggested readiness check pattern
 systemctl restart postgresql
-sleep 30
+# Wait for PostgreSQL to be ready
+for i in {1..30}; do
+  if psql -U postgres -d postgres -c "SELECT 1" &>/dev/null; then
+    break
+  fi
+  sleep 1
+done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh` around lines 100 - 101,
Replace the fixed sleep after restarting PostgreSQL in run_pg_tpcc.sh with a
readiness polling loop that repeatedly checks the server is accepting
connections (e.g., using pg_isready or psql -c '\q') until it succeeds or a
configurable timeout is reached; locate the restart call around "systemctl
restart postgresql" and swap out "sleep 30" for the loop, log each attempt, use
a short backoff between tries, and fail the script with a clear error if the
timeout elapses.
hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh (1)

92-93: ⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Fixed sleep duration is fragile.

As noted in previous review, the 60-second sleep may not be sufficient for MSSQL restart. A readiness check would be more reliable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh` around lines 92 - 93, The
fixed "sleep 60" in run_mssql_tpcc.sh (the echo "Waiting 60 seconds for DB to
start" / sleep 60 block) is fragile; replace it with an active readiness loop
that polls MSSQL until it accepts connections (for example using sqlcmd -Q
"SELECT 1" or checking the TCP port with nc/tcping) with a configurable timeout
and short sleep/backoff between attempts, fail if timeout elapses, and log each
attempt; update the script to remove the hardcoded sleep and use that loop so
the script continues only when the DB is actually ready.
hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh (1)

61-62: ⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Fixed sleep duration is fragile.

As noted in previous review, the 60-second sleep may not be sufficient for MSSQL startup. A readiness check would be more reliable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh` around lines 61 - 62,
Replace the fixed "sleep 60" wait in build_mssql_tpcc.sh with a readiness loop
that polls MSSQL until it is accepting connections (e.g., use sqlcmd -S
<host>,<port> or a TCP check on port 1433) and only proceeds when a successful
connection/response is observed or a configurable timeout expires; update the
echo "Waiting 60 seconds for DB to start" messaging to reflect the polling
behavior and ensure any failure path exits non‑zero after the timeout.
🧹 Nitpick comments (1)
hammerdb/hammerdb_scripts/mssql/mssql.conf (1)

1-23: ⚡ Quick win

Configuration file appears redundant with dynamic generation.

The wrapper orchestration calls mssql_settings.sh which uses mssql-conf commands to dynamically generate /var/opt/mssql/mssql.conf. This static file is never directly consumed by the installation flow, which could create confusion about which configuration is authoritative. If this file serves as documentation or a reference template, consider adding a comment header to clarify its purpose and relationship to mssql_settings.sh.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mssql/mssql.conf` around lines 1 - 23, The
mssql.conf file appears redundant because the installation flow dynamically
generates /var/opt/mssql/mssql.conf via the mssql_settings.sh wrapper which
invokes mssql-conf; add a clear comment header at the top of this static
mssql.conf explaining that it is a reference/template only (not used at
runtime), pointing to mssql_settings.sh and mssql-conf as the authoritative
source, or remove the static file if it serves no purpose; reference the static
file name mssql.conf and the scripts/commands mssql_settings.sh and mssql-conf
in the header so readers know which is authoritative.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh`:
- Around line 71-73: Replace the blind restart + fixed sleep with a readiness
poll: after the existing systemctl restart mariadb.service in
build_mariadb_tpcc.sh (and mirror the same change in run_mariadb_tpcc.sh),
implement a loop that repeatedly runs mysqladmin ping (using the same root/user
credentials or socket used elsewhere) until it returns a successful response or
a timeout is reached, logging progress and failing with a clear error if the DB
never becomes available; keep the "Restarted DB" log but only emit it once
mysqladmin ping succeeds to ensure subsequent DB operations run only when
MariaDB is accepting connections.
- Line 79: The command in build_mariadb_tpcc.sh that uses a hardcoded password
("mysql -pabcdefgh -e 'drop database tpcc;'") exposes credentials in the process
list; instead create a temporary MySQL client config file and pass it with
--defaults-file to avoid putting the password on the command line: create a tmp
file with [client] section containing user and password, chmod 600, run mysql
--defaults-file="$TMP" -e 'drop database tpcc;', and ensure the script unlinks
the temp file (use a trap to remove it on exit) so credentials are not left on
disk.

In `@hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh`:
- Line 6: The script uses ${benchmark_run_dir} when writing
user-benchmark-name.txt but never initializes it; update the top of the script
to define benchmark_run_dir (e.g., read from an environment variable or set a
sensible default like ./runs) and add a guard that errors out if it's still
empty; ensure the directory exists (mkdir -p "${benchmark_run_dir}") before
running echo ${benchmark_name} > "${benchmark_run_dir}/user-benchmark-name.txt"
so the write cannot fail due to an undefined variable or missing directory.

In `@hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh`:
- Around line 1-10: Ensure the script validates the -m argument: when parsing
the case for -m (the mountpoint variable) verify a non-empty $2 exists and after
the parsing loop add a check like if [ -z "$mountpoint" ]; then echo "Usage: ...
-m <mountpoint>" >&2; exit 1; fi so the script fails fast instead of using an
empty ${mountpoint} in SQL file paths; place the check before export mountpoint
and before any use of ${mountpoint}.
- Around line 1-35: Add a shebang and fail-fast error handling: add a top-line
shebang (bash) and enable strict mode (e.g., set -euo pipefail) so the script
exits on unbound vars or failures, validate that the parsed mountpoint variable
is non-empty before using it, run the sqlcmd here-doc as currently invoked
(/opt/mssql-tools/bin/sqlcmd -U sa -P abcdefgh <<! ) but capture its exit status
immediately afterward and if non-zero emit an error to stderr and exit with that
status; also ensure any subsequent steps (like the ALTER DATABASE ADD FILE
block) are only executed when sqlcmd succeeds.

In `@hammerdb/hammerdb_scripts/mssql/createdb_mssql.sh`:
- Line 2: Replace the hardcoded SA password used in the sqlcmd invocation (the
line starting with "/opt/mssql-tools/bin/sqlcmd -U sa -P abcdefgh") with a
secure retrieval from an environment variable (e.g., ${MSSQL_SA_PASSWORD}) in
createdb_mssql.sh and make the same change in createdb_mssql_mnt.sh and
build_mssql.tcl; additionally, add a guard that fails fast with a clear error if
MSSQL_SA_PASSWORD is not set, and consider switching to a credential store or
integrated authentication where available instead of embedding secrets in
scripts.
- Around line 3-4: The script currently runs an unconditional "DROP DATABASE
tpcc" which will error if the database does not exist; change this to use the
idempotent form "DROP DATABASE IF EXISTS tpcc" (or wrap the drop in TRY/CATCH)
so the batch does not abort on first run—update the statement in
createdb_mssql.sh (the "DROP DATABASE tpcc" line) to the IF EXISTS variant or
add proper error handling around the DROP DATABASE call.
- Around line 1-24: Add a shebang (e.g., #!/bin/bash) at the top and enable
strict error handling (use set -euo pipefail) so the script exits on failure;
ensure the block that invokes /opt/mssql-tools/bin/sqlcmd is run with error
checking and propagate non-zero exit codes instead of silently continuing (refer
to the sqlcmd invocation and the existing exit marker in the here-doc), and
optionally capture sqlcmd errors to stderr before exiting so the caller/wrapper
can detect and log failures.

In `@hammerdb/hammerdb_scripts/mssql/mssql_settings.sh`:
- Line 1: Add a shebang line to the very top of the script so the interpreter is
explicit: insert the bash shebang (#!/bin/bash) as the first line before the
existing header comment "## Setting control parameters" in mssql_settings.sh;
ensure the shebang is the file's first line so the script runs reliably under
bash when executed.
- Around line 2-22: The script runs many /opt/mssql/bin/mssql-conf invocations
(e.g., control.alternatewritethrough, control.writethrough,
memory.disablememorypressure and multiple traceflag calls) without checking
errors; update mssql_settings.sh to validate each mssql-conf command return code
(or wrap calls in a helper like run_mssql_conf) and on failure emit a clear
error message and exit non‑zero so the wrapper stops and MSSQL isn’t restarted
with partial/failed configuration; ensure the log includes which mssql-conf
subcommand failed (e.g., the specific traceflag or setting name) to aid
debugging.

In `@hammerdb/hammerdb_scripts/mssql/update_temp.sh`:
- Line 20: The scripts use a hardcoded SA password ("abcdefgh") in the sqlcmd
invocation (seen in update_temp.sh, runtest_mssql.tcl, and run_mssql_tpcc.sh);
replace that hardcoded password by reading a validated environment variable
(MSSQL_SA_PASSWORD) at the start of each script, fail fast with a clear error if
it's empty/unset, and pass the variable into the sqlcmd -P argument (and any
other places that reference the plaintext secret) so credential rotation and
secure injection via CI/runtime secrets is possible.

In `@hammerdb/hammerdb_scripts/postgres/pg_hba.conf`:
- Around line 3-5: Replace the insecure "trust" entries — specifically the
"local   all             all                                     trust" and
"host    all             all             all            trust" lines — with
secure defaults: use "local   all   all   peer" for local socket auth and
restrict remote "host" entries to localhost (e.g., "host   all   all  
127.0.0.1/32   scram-sha-256") or explicit benchmark-only CIDRs and
authentication method "scram-sha-256" (or "md5" if SCRAM not available). Add a
top-of-file comment warning that this file is intended only for isolated
benchmark environments and must not be deployed to production or untrusted
networks. Ensure any broader host CIDRs are intentionally limited and
documented.

In `@hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh`:
- Line 92: The CSV filename is wrong: in run_pg_tpcc.sh the echo line writing
"Run_mariadb_tpm.csv" should be changed to a Postgres-specific name (e.g.,
"Run_postgres_tpm.csv" or "Run_pg_tpm.csv") so the output file correctly
reflects this script's database; update the string in the echo command (the line
that currently contains echo
"StartTime,EndTime,Hostname,Kernel,Database,DBVer,Cpus,Memory,StorageType,Users,Tpm"
> Run_mariadb_tpm.csv) and search for any other references to
"Run_mariadb_tpm.csv" in the script to rename them consistently.
- Line 112: The script currently copies the wrong config file via the command
"cp /etc/my.cnf $benchmark_results_dir"; change this to copy the PostgreSQL
config (e.g., replace with copying "/var/lib/pgsql/data/postgresql.conf" or the
appropriate postgresql.conf on target systems) or remove the copy line if the
PostgreSQL config is already captured elsewhere; ensure you keep the destination
variable "$benchmark_results_dir" so the file is archived correctly.

In `@hammerdb/install-script`:
- Around line 269-281: The script currently downloads and immediately executes
HammerDB-3.2-Linux-x86-64-Install as root (using variables hmd_dir and the
installer name) without any integrity/authenticity checks; change the flow to
first download the installer to a temporary location, verify its checksum or
signature against a pinned digest/signature for the HammerDB release, and only
if the verification passes proceed to set permissions (chmod 755) and run the
installer (the invocation that redirects input from the generated input file).
Fail closed (exit non-zero) if verification fails and log a clear error
mentioning the installer name and expected digest.
- Line 24: The install-script assumes local wrapper variables (hmd_dir,
script_dir, run_dir) exist on the remote host and uses them (e.g., paths
referenced in hammerdb/run_hammerdb when it SSHes and runs ./install-script),
causing missing-path failures on fresh nodes; update install-script to derive or
create these paths at runtime (compute default values if env vars are unset and
mkdir -p them), or stage/copy the wrapper config and hammerdb_scripts tree to
the remote before invoking install-script; ensure all references to hmd_dir,
script_dir, and run_dir inside install-script (and affected lines around the
listed ranges) fall back to computed defaults and create the directories so
package setup and DB script staging succeed on fresh remotes.
- Around line 54-64: Hardcoded MSSQL SA password is insecure: stop setting
MSSQL_SA_PASSWORD="abcdefgh" in the script and instead accept a secret from
outside or generate and persist a per-run random value; update the install flow
so the script reads MSSQL_SA_PASSWORD from the environment or from a provided
config file/CLI argument (falling back to generating a strong random password at
runtime), export that value as MSSQL_SA_PASSWORD before starting MSSQL, and
ensure any other consumer (the MSSQL runner) reads the same env variable rather
than relying on the baked-in string.

---

Duplicate comments:
In `@hammerdb/hammerdb_scripts/mariadb/my.cnf`:
- Line 4: The my.cnf currently hardcodes datadir=/perf1/mysql/data which can
cause startup failures if that path doesn't exist; update the deployment to make
the datadir configurable instead of hardcoded by reading it from an environment
variable or build-time config and substituting it into the my.cnf, or document
the required path in the setup instructions; specifically modify the
configuration generation step (the code that writes/installs my.cnf) to replace
the literal "datadir=/perf1/mysql/data" with a templated value sourced from the
build script or env var and add validation to ensure the target directory exists
before starting MariaDB.

In `@hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh`:
- Line 17: Update the usage string in the script's help/usage output where it
currently says "run_mssql_tpcc.sh ..." to the correct script name
"run_mariadb_tpcc.sh" so the usage line accurately reflects this file; locate
and edit the usage/USAGE variable or echo statement in run_mariadb_tpcc.sh that
prints the usage help and replace the incorrect script name.

In `@hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh`:
- Around line 61-62: Replace the fixed "sleep 60" wait in build_mssql_tpcc.sh
with a readiness loop that polls MSSQL until it is accepting connections (e.g.,
use sqlcmd -S <host>,<port> or a TCP check on port 1433) and only proceeds when
a successful connection/response is observed or a configurable timeout expires;
update the echo "Waiting 60 seconds for DB to start" messaging to reflect the
polling behavior and ensure any failure path exits non‑zero after the timeout.

In `@hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh`:
- Around line 92-93: The fixed "sleep 60" in run_mssql_tpcc.sh (the echo
"Waiting 60 seconds for DB to start" / sleep 60 block) is fragile; replace it
with an active readiness loop that polls MSSQL until it accepts connections (for
example using sqlcmd -Q "SELECT 1" or checking the TCP port with nc/tcping) with
a configurable timeout and short sleep/backoff between attempts, fail if timeout
elapses, and log each attempt; update the script to remove the hardcoded sleep
and use that loop so the script continues only when the DB is actually ready.

In `@hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh`:
- Around line 77-78: Replace the fixed "sleep 30" after "systemctl start
postgresql" with a readiness polling loop that checks service readiness (e.g.,
using "systemctl is-active postgresql" and/or "pg_isready") until successful or
a short timeout is reached; if the check fails before the timeout, emit an error
and exit non‑zero. Update the script around the "systemctl start postgresql"
call to repeatedly poll at short intervals (e.g., 1s) and break when the service
is active/pg_isready returns OK, otherwise fail after the timeout.

In `@hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh`:
- Around line 100-101: Replace the fixed sleep after restarting PostgreSQL in
run_pg_tpcc.sh with a readiness polling loop that repeatedly checks the server
is accepting connections (e.g., using pg_isready or psql -c '\q') until it
succeeds or a configurable timeout is reached; locate the restart call around
"systemctl restart postgresql" and swap out "sleep 30" for the loop, log each
attempt, use a short backoff between tries, and fail the script with a clear
error if the timeout elapses.

---

Nitpick comments:
In `@hammerdb/hammerdb_scripts/mssql/mssql.conf`:
- Around line 1-23: The mssql.conf file appears redundant because the
installation flow dynamically generates /var/opt/mssql/mssql.conf via the
mssql_settings.sh wrapper which invokes mssql-conf; add a clear comment header
at the top of this static mssql.conf explaining that it is a reference/template
only (not used at runtime), pointing to mssql_settings.sh and mssql-conf as the
authoritative source, or remove the static file if it serves no purpose;
reference the static file name mssql.conf and the scripts/commands
mssql_settings.sh and mssql-conf in the header so readers know which is
authoritative.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: a2dcca62-c9ba-4fc3-b626-a724904e2f78

📥 Commits

Reviewing files that changed from the base of the PR and between c26f13c and 1838b42.

📒 Files selected for processing (26)
  • hammerdb/hammerdb
  • hammerdb/hammerdb.json
  • hammerdb/hammerdb_mssql.json
  • hammerdb/hammerdb_scripts/mariadb/build_mariadb.tcl
  • hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh
  • hammerdb/hammerdb_scripts/mariadb/libmysqlclient.so.20
  • hammerdb/hammerdb_scripts/mariadb/my.cnf
  • hammerdb/hammerdb_scripts/mariadb/run_mariadb_tpcc.sh
  • hammerdb/hammerdb_scripts/mariadb/runtest_mariadb.tcl
  • hammerdb/hammerdb_scripts/mssql/build_mssql.tcl
  • hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh
  • hammerdb/hammerdb_scripts/mssql/createdb_mssql.sh
  • hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh
  • hammerdb/hammerdb_scripts/mssql/mssql.conf
  • hammerdb/hammerdb_scripts/mssql/mssql_settings.sh
  • hammerdb/hammerdb_scripts/mssql/run_mssql_tpcc.sh
  • hammerdb/hammerdb_scripts/mssql/runtest_mssql.tcl
  • hammerdb/hammerdb_scripts/mssql/update_temp.sh
  • hammerdb/hammerdb_scripts/postgres/build_pg.tcl
  • hammerdb/hammerdb_scripts/postgres/build_pg_tpcc.sh
  • hammerdb/hammerdb_scripts/postgres/pg_hba.conf
  • hammerdb/hammerdb_scripts/postgres/postgresql.conf
  • hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh
  • hammerdb/hammerdb_scripts/postgres/runtest_pg.tcl
  • hammerdb/install-script
  • hammerdb/run_hammerdb

Comment thread hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mariadb/build_mariadb_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/build_mssql_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh
Comment thread hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh
Comment thread hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh Outdated
Comment thread hammerdb/hammerdb_scripts/postgres/run_pg_tpcc.sh Outdated
Comment thread hammerdb/install-script
Comment thread hammerdb/install-script
Comment thread hammerdb/install-script

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh (2)

8-15: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Potential infinite loop in argument parsing

If any argument other than -m is passed, Line 8 loop never shifts $1, so the script can hang indefinitely. Add a default *) branch that errors and exits (or at least shifts).

As per coding guidelines, this is a major reliability issue and should be fixed before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh` around lines 8 - 15,
The argument-parsing loop in the script (the while [ $# -gt 0 ] ... case $1 in)
can hang when an unrecognized flag is passed because only the -m case shifts
arguments; add a default case *) that either prints an error and exits non-zero
or at minimum shifts past the unknown argument so the loop progresses; update
the case block handling for -m and the new *) branch to ensure $1/$2 are
consumed and mountpoint is still set by the -m handler.

Source: Coding guidelines


20-42: ⚠️ Potential issue | 🟠 Major

Add -b to sqlcmd to fail fast on SQL errors (createdb_mssql_mnt.sh, lines 20-42)

The script uses set -e, but sqlcmd is invoked without -b, so T-SQL errors may not cause sqlcmd to exit non-zero—allowing the install flow to continue after failed CREATE DATABASE / ALTER DATABASE operations.

Suggested patch
-/opt/mssql-tools/bin/sqlcmd -U sa -P abcdefgh <<! 
+/opt/mssql-tools/bin/sqlcmd -b -U sa -P abcdefgh <<!
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh` around lines 20 - 42,
The sqlcmd invocation in createdb_mssql_mnt.sh (/opt/mssql-tools/bin/sqlcmd -U
sa -P abcdefgh <<!) must pass -b so sqlcmd exits with non‑zero on T‑SQL errors;
update the sqlcmd command to include the -b flag (keeping the existing -U, -P
and the here‑doc delimiter '!') so any CREATE/ALTER DATABASE failures cause the
script to fail fast and propagate the error to the shell (ensure the here‑doc
content and exit/! delimiter remain unchanged).

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh`:
- Around line 8-15: The argument-parsing loop in the script (the while [ $# -gt
0 ] ... case $1 in) can hang when an unrecognized flag is passed because only
the -m case shifts arguments; add a default case *) that either prints an error
and exits non-zero or at minimum shifts past the unknown argument so the loop
progresses; update the case block handling for -m and the new *) branch to
ensure $1/$2 are consumed and mountpoint is still set by the -m handler.
- Around line 20-42: The sqlcmd invocation in createdb_mssql_mnt.sh
(/opt/mssql-tools/bin/sqlcmd -U sa -P abcdefgh <<!) must pass -b so sqlcmd exits
with non‑zero on T‑SQL errors; update the sqlcmd command to include the -b flag
(keeping the existing -U, -P and the here‑doc delimiter '!') so any CREATE/ALTER
DATABASE failures cause the script to fail fast and propagate the error to the
shell (ensure the here‑doc content and exit/! delimiter remain unchanged).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: b2255c5d-5b9e-439c-b4f0-d3565abdc78d

📥 Commits

Reviewing files that changed from the base of the PR and between 1838b42 and 28b5d55.

📒 Files selected for processing (1)
  • hammerdb/hammerdb_scripts/mssql/createdb_mssql_mnt.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hammerdb install update

2 participants