Skip to content

Conversation

@luohaha
Copy link
Contributor

@luohaha luohaha commented Sep 29, 2025

Why I'm doing:

This PR contains two changes:

  1. Primary key consistency test supports PK parallel execution
  2. Remove rep_->closed check in ~TableBuilder, because it's unnecessary.

What I'm doing:

This pull request updates the Lake primary key consistency tests to use string (VARCHAR) primary keys instead of integers, and introduces randomized configuration changes to improve test coverage for index flushing and parallel execution. The changes also include internal refactoring to support the new key type and enhance the robustness of the tests.

Primary Key Type Migration:

  • Changed all primary key columns (c0) in the test schema and related logic from integer (INT) to string (VARCHAR), including schema definitions, slot setup, and column creation. [1] [2] [3] [4] [5]
  • Updated all internal maps and key handling in the Replayer class and related test logic to use std::string instead of int for primary key storage and comparisons. [1] [2] [3] [4]

Test Robustness and Randomization:

  • Added helper methods to randomly force index memtable flushes (5% chance) and enable PK parallel execution (50% chance) during test operations, increasing scenario coverage and stress-testing concurrency.
  • Integrated these random configuration changes into all major test operations, such as upsert, delete, partial update, condition update, batch publish, and compaction. [1] [2] [3] [4] [5] [6]

Configuration Management:

  • Added backup and restoration of the pk_parallel_execution_threshold_bytes configuration to ensure test isolation and prevent side effects. [1] [2]

Other Minor Changes:

  • Increased test duration for the local PK consistency test to allow for more extensive randomized testing.
  • Limited test instantiation to only the CLOUD_NATIVE persistent index type, removing the LOCAL type from test parameters.

Code Quality:

  • Removed an unnecessary assertion in the TableBuilder destructor to avoid potential false positives when closing resources.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

@luohaha luohaha requested a review from a team as a code owner September 29, 2025 09:42
Signed-off-by: luohaha <[email protected]>
@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@kevincai kevincai merged commit 4918a1f into StarRocks:main Oct 9, 2025
52 checks passed
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.

3 participants