Skip to content

Fix Sysbench TPCC PopulateDatabase passing --warehouses 0 on small VMs#675

Merged
AlexW-F merged 2 commits intomainfrom
users/alexwill/sysbench0fix
Apr 6, 2026
Merged

Fix Sysbench TPCC PopulateDatabase passing --warehouses 0 on small VMs#675
AlexW-F merged 2 commits intomainfrom
users/alexwill/sysbench0fix

Conversation

@AlexW-F
Copy link
Copy Markdown
Contributor

@AlexW-F AlexW-F commented Apr 6, 2026

On VMs with 4 vCPUs or fewer, GetWarehouseCount returns 1, causing the Populate mode calculation (warehouseEstimate - 1) to yield 0. This passes --warehouses 0 to populate-database.py, which calls sysbench tpcc prepare with --scale=0, dropping and recreating all tables with zero data. The client then fails with nil value errors on every run attempt.

Fix: Use Math.Max(1, warehouseEstimate - 1) to ensure at least 1 warehouse is always passed to the populate step.

On VMs with 4 vCPUs or fewer, GetWarehouseCount returns 1, causing the
Populate mode calculation (warehouseEstimate - 1) to yield 0. This passes
--warehouses 0 to populate-database.py, which calls sysbench tpcc prepare
with --scale=0, dropping and recreating all tables with zero data. The
client then fails with nil value errors on every run attempt.

Fix: Use Math.Max(1, warehouseEstimate - 1) to ensure at least 1 warehouse
is always passed to the populate step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AlexW-F AlexW-F enabled auto-merge (squash) April 6, 2026 17:18
@AlexW-F AlexW-F disabled auto-merge April 6, 2026 17:18
@AlexW-F AlexW-F enabled auto-merge (squash) April 6, 2026 17:18
@AlexW-F AlexW-F merged commit a9fb406 into main Apr 6, 2026
5 checks passed
@AlexW-F AlexW-F deleted the users/alexwill/sysbench0fix branch April 6, 2026 17:27
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.

2 participants