Skip to content

Commit

Permalink
[#15885] Fix flaky test PgMiniTest.TabletSplitSecondaryIndexYSQL
Browse files Browse the repository at this point in the history
Summary: The test expects the main table to split during the test. This doesn't always happen because the sst files generated are less than the force split threshold set in the test. Fixing it to 10K should cause it split more predictably. This gflag is only used for this one test, so it shouldn't affect other tests.

Test Plan:
Run the test a few times.

```
./yb_build.sh release --cxx-test pg_mini-test --gtest_filter PgMiniTest.TabletSplitSecondaryIndexYSQL
```

Reviewers: asrivastava

Reviewed By: asrivastava

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D40801
  • Loading branch information
sanketh committed Dec 20, 2024
1 parent eff21a0 commit 0b67a96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/yb/yql/pgwrapper/pg_mini-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,7 @@ class PgMiniTabletSplitTest : public PgMiniTest {
ANNOTATE_UNPROTECTED_WRITE(FLAGS_tablet_split_high_phase_size_threshold_bytes) = 0;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_tablet_split_low_phase_shard_count_per_node) = 0;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_tablet_split_high_phase_shard_count_per_node) = 0;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_tablet_force_split_threshold_bytes) = 30_KB;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_tablet_force_split_threshold_bytes) = 10_KB;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_db_write_buffer_size) =
FLAGS_tablet_force_split_threshold_bytes / 4;
ANNOTATE_UNPROTECTED_WRITE(FLAGS_db_block_size_bytes) = 2_KB;
Expand Down Expand Up @@ -1774,11 +1774,13 @@ void PgMiniTest::StartReadWriteThreads(const std::string table_name,
TestThreadHolder *thread_holder) {
// Writer thread that does parallel writes into table
thread_holder->AddThread([this, table_name] {
LOG(INFO) << "Starting writes to " << table_name;
auto conn = ASSERT_RESULT(Connect());
for (int i = 501; i < 2000; i++) {
ASSERT_OK(conn.ExecuteFormat("INSERT INTO $0 VALUES ($1, $2, $3, $4)",
table_name, i, i, i, 1));
}
LOG(INFO) << "Completed writes to " << table_name;
});

// Index read from the table
Expand Down

0 comments on commit 0b67a96

Please sign in to comment.