Skip to content

Tpcc import with arenas (#17333) #20756

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eivanov89
Copy link
Member

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@eivanov89 eivanov89 requested review from pnv1 and Copilot July 7, 2025 18:06
@eivanov89 eivanov89 requested a review from a team as a code owner July 7, 2025 18:06
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 adds optional Protobuf Arena support to TValueBuilder, enabling arena-allocated Ydb::Value instances, and updates the TPCC import code to use a single google::protobuf::Arena per thread for all bulk upserts.

  • Extended TValueBuilderImpl and TValueBuilderBase to accept an optional Arena pointer and to allocate from it.
  • Modified all TPCC Load* functions to take a google::protobuf::Arena&, pass it to TValueBuilder, apply it in BulkUpsertSettings, and reset after each call.
  • Updated constructors in value.cpp/value.h and added the necessary protobuf includes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ydb/public/sdk/cpp/src/client/value/value.cpp Added Arena member, heap vs. arena allocation logic
ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/value/value.h Changed builder constructors to take optional arena
ydb/library/workload/tpcc/import.cpp Updated TPCC import to use and reset a shared arena
Comments suppressed due to low confidence (3)

ydb/public/sdk/cpp/src/client/value/value.cpp:2825

  • [nitpick] Member 'Arena' lacks a trailing underscore and is inconsistent with other members (e.g., TypeBuilder_). Consider renaming to 'Arena_'.
    google::protobuf::Arena* Arena;

ydb/public/sdk/cpp/src/client/value/value.cpp:2826

  • [nitpick] Member 'ProtoValueHeap' does not follow the trailing underscore convention of other private members. Consider renaming to 'ProtoValueHeap_'.
    Ydb::Value ProtoValueHeap;

ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/value/value.h:533

  • New arena‐enabled constructor path is not covered by existing tests. Consider adding unit tests for both heap and arena cases to ensure BuildValue behaves correctly.
    TValueBuilderBase(google::protobuf::Arena* arena = nullptr);

Copy link

github-actions bot commented Jul 7, 2025

🟢 2025-07-07 18:09:11 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Jul 7, 2025

2025-07-07 18:32:58 UTC Pre-commit check linux-x86_64-release-asan for aa4c480 has started.
2025-07-07 18:33:11 UTC Artifacts will be uploaded here
2025-07-07 18:36:41 UTC ya make is running...
🟡 2025-07-07 20:50:11 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16565 16030 0 305 199 31

🟢 2025-07-07 20:51:39 UTC Build successful.
🟢 2025-07-07 20:52:11 UTC ydbd size 3.9 GiB changed* by +2.3 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: fff1a83 merge: aa4c480 diff diff %
ydbd size 4 200 367 888 Bytes 4 200 370 216 Bytes +2.3 KiB +0.000%
ydbd stripped size 1 455 387 032 Bytes 1 455 387 928 Bytes +896 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

github-actions bot commented Jul 7, 2025

2025-07-07 18:33:05 UTC Pre-commit check linux-x86_64-relwithdebinfo for aa4c480 has started.
2025-07-07 18:33:17 UTC Artifacts will be uploaded here
2025-07-07 18:36:47 UTC ya make is running...
🟡 2025-07-07 20:19:47 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
38982 36241 0 2 2690 49

2025-07-07 20:23:18 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-07-07 20:39:32 UTC Tests successful.

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

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
534 (only retried tests) 481 0 0 15 38

🟢 2025-07-07 20:39:44 UTC Build successful.
🟢 2025-07-07 20:40:05 UTC ydbd size 2.2 GiB changed* by +1.7 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: fff1a83 merge: aa4c480 diff diff %
ydbd size 2 388 089 616 Bytes 2 388 091 320 Bytes +1.7 KiB +0.000%
ydbd stripped size 499 675 880 Bytes 499 676 456 Bytes +576 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

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.

1 participant