Skip to content

Tpcc import imrovements (#17333) #19791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

eivanov89
Copy link
Member

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@eivanov89 eivanov89 requested a review from Copilot June 18, 2025 08:52
@eivanov89 eivanov89 requested a review from a team as a code owner June 18, 2025 08:52
Copy link

🟢 2025-06-18 08:53:01 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 08:53:22 UTC Pre-commit check linux-x86_64-relwithdebinfo for ac637bd has started.
2025-06-18 08:53:33 UTC Artifacts will be uploaded here
2025-06-18 08:56:09 UTC ya make is running...
🟢 2025-06-18 09:14:06 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
2164 2157 0 0 3 4

🟢 2025-06-18 09:14:24 UTC Build successful.
🟢 2025-06-18 09:14:38 UTC ydbd size 2.2 GiB changed* by +84.7 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: a74e33c merge: ac637bd diff diff %
ydbd size 2 372 913 808 Bytes 2 373 000 552 Bytes +84.7 KiB +0.004%
ydbd stripped size 497 509 960 Bytes 497 531 656 Bytes +21.2 KiB +0.004%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 08:53:22 UTC Pre-commit check linux-x86_64-release-asan for ac637bd has started.
2025-06-18 08:53:34 UTC Artifacts will be uploaded here
2025-06-18 08:56:10 UTC ya make is running...
🟡 2025-06-18 09:35:06 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1388 1287 0 12 82 7

2025-06-18 09:35:22 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-18 09:59:55 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
200 (only retried tests) 127 0 9 58 6

2025-06-18 10:00:03 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-06-18 10:21:49 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
159 (only retried tests) 129 0 7 17 6

🟢 2025-06-18 10:21:59 UTC Build successful.
🟢 2025-06-18 10:22:18 UTC ydbd size 3.9 GiB changed* by -48 Bytes, which is <= 0 Bytes vs main: OK

ydbd size dash main: abeada2 merge: ac637bd diff diff %
ydbd size 4 173 702 408 Bytes 4 173 702 360 Bytes -48 Bytes -0.000%
ydbd stripped size 1 447 299 032 Bytes 1 447 298 968 Bytes -64 Bytes -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the TPCC import tool by tightening CLI option requirements, improving interrupt- and retry-handling in the loader, and adding sanity assertions to data-splitting unit tests.

  • Require --warehouses (and hide --log-level) in the tpcc init, import, and run commands
  • Add global interrupt checks and more granular retry-logic in ExecuteWithRetry and TPCCLoader
  • Strengthen unit tests with non-negative/assert‐positive split counts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ydb/public/lib/ydb_cli/commands/ydb_workload_tpcc.cpp Made Config overrides non-virtual, required warehouse arg
ydb/library/workload/tpcc/ut/data_splitter_ut.cpp Added UNIT_ASSERT checks for non-negative split counts
ydb/library/workload/tpcc/import.cpp Switched to global interrupt source; refined retry logging
Comments suppressed due to low confidence (1)

ydb/public/lib/ydb_cli/commands/ydb_workload_tpcc.cpp:112

  • The tpcc import and tpcc run commands now require --warehouses, but only tpcc init has a hidden --log-level option. For consistency, consider adding the --log-level flag to the import and run command configurations as well.
        'w', "warehouses", TStringBuilder() << "Number of warehouses")

@@ -73,6 +74,7 @@ Y_UNIT_TEST_SUITE(TDataSplitterTest) {
int stockWarehousesPerShard2 = (1000 + minShardCount - 1) / minShardCount;
stockWarehousesPerShard = std::min(stockWarehousesPerShard, stockWarehousesPerShard2);
int expectedStockSplits = (1000 - 1) / stockWarehousesPerShard;
UNIT_ASSERT(expectedStockSplits > 0);
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

The first assertion uses >= 0 but here you use > 0, which is inconsistent and may fail if zero splits are valid. Consider standardizing on one boundary check (e.g. >= 0) or adding a comment explaining why zero is invalid.

Suggested change
UNIT_ASSERT(expectedStockSplits > 0);
UNIT_ASSERT(expectedStockSplits >= 0); // Ensure consistency with earlier assertions

Copilot uses AI. Check for mistakes.

@@ -511,15 +511,28 @@ NTable::TBulkUpsertResult LoadOrderLines(
template<typename LoadFunc>
void ExecuteWithRetry(const TString& operationName, LoadFunc loadFunc, TLog* Log) {
for (int retryCount = 0; retryCount < MAX_RETRIES; ++retryCount) {
if (GetGlobalInterruptSource().stop_requested()) {
break;
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

[nitpick] Breaking out of the retry loop on interrupt will naturally exit the function, but using return; instead of break; makes the intent explicit and avoids confusion about control flow.

Suggested change
break;
return;

Copilot uses AI. Check for mistakes.

@eivanov89 eivanov89 merged commit e1eaa1b into ydb-platform:main Jun 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants