Skip to content

[fix](cloud) Add the aggregation output rowset to the delete bitmap replacement test - #69349

Merged
morningman merged 2 commits into
apache:masterfrom
morningman:fix-cloud-dbm-replacement-test
Oct 20, 2026
Merged

morningman merged 2 commits into
apache:masterfrom
morningman:fix-cloud-dbm-replacement-test

Conversation

@morningman

@morningman morningman commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #68084, #68100

Problem Summary:

In short

MetaServiceTest.GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld has failed on master since #68084 and #68100 were merged two minutes apart on 2026-10-20, so the Cloud UT pipeline is red for every PR. The test, added by #68100, injects a compaction aggregation without the output rowset that #68084 started to require, so the meta service skips the aggregation as obsolete. This PR adds that rowset to the test, the way #68084 did for the other aggregation tests. It changes one line of a test and no meta service code.

Background

The problem, and what it cost

  • With [fix](cloud) Skip stale delete bitmap aggregation #68084, the injected aggregation has no output rowset at version 2, so check_pre_rowset_aggregation skips it. The restarted read returns the old three-chunk bitmap, the byte threshold stops it before following_rowset, and the first iteration fails:
cloud/test/meta_service_test.cpp:8501: Failure
Expected equality of these values:
  get_res.rowset_ids_size()
    Which is: 3
  expected_bitmap_count
    Which is: 4
Google Test trace:
cloud/test/meta_service_test.cpp:8382: replacement_size=1

How this PR fixes it

Add the output rowset of the injected aggregation to the test, as #68084 did for the other aggregation tests:

put_delete_bitmap_test_rowset(meta_service.get(), instance_id, tablet_id, 2, "r1-2", 1);

With it, the check passes, the replacement is written, and the test exercises the restarted read it was written for. Only that check reads the new rowset meta; get_delete_bitmap does not read rowset metas, so nothing else in the test changes.

Results

run-cloud-ut.sh --run in a Linux arm64 container (Debian 12, ldb toolchain v0.25, the linux-aarch64 prebuilt third-party tree, a local FDB 7.1.57):

Run, on master 33c460d7365 GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld Other tests
without this PR (the added line removed) fails as on the pipeline: 3 rowset ids instead of 4, under replacement_size=1 not run
with this PR passes all 33 test binaries pass except StopWatchTest.SimpleTest

The same two runs on master 1d03523339f, before the rebase, gave the same results.

Classes, and how they call each other

MetaServiceTest.GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld
 ├─ put_delete_bitmap_test_rowset(version 1, rowset_id)
 ├─ put_delete_bitmap_test_rowset(version 2, "r1-2", start 1)       <- added
 └─ MetaServiceImpl::get_delete_bitmap
      └─ sync point "get_delete_bitmap_err" (in the middle of the read)
           ├─ MetaServiceImpl::update_delete_bitmap(lock_id -3, aggregation [1, 2])
           │    └─ check_pre_rowset_aggregation: the rowset meta at version 2 must cover [1, 2]
           └─ TXN_TOO_OLD -> get_delete_bitmap restarts the read

Nothing outside cloud/test/meta_service_test.cpp changes.

Merge order

No dependency on master. On branch-4.2 this should go in together with #69306 (the pick of #68084), or right after it.

Release note

None

Check List (For Author)

  • Test

    • Regression test

    • Unit Test

    • Manual test (add detailed scripts or steps below)

    • No need to test or manual test. Explain why:

      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
    • run-cloud-ut.sh --run, see Results. The only other failure seen is StopWatchTest.SimpleTest, which does not involve this change: it allows 500 us of oversleep over two 1 ms sleeps, and in that VM a 1 ms sleep often takes about 1.3 ms.

    • clang-format 16 reports no changes.

  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

…eplacement test

### What problem does this PR solve?

Issue Number: None

Related PR: apache#68084, apache#68100

Problem Summary:

apache#68084 (merged 2026-10-20 09:45 +08:00) made update_delete_bitmap check, in
every MS transaction, that a compaction aggregation request (lock_id -3,
without_lock, pre_rowset_agg_start_version / pre_rowset_agg_end_version)
still has a live output rowset: the rowset meta at the end version must exist
and cover [start, end]. Otherwise the request is treated as obsolete and
returns OK without writing anything. apache#68084 added that output rowset
(`put_delete_bitmap_test_rowset(..., 2, "r1-2", 1)`) to the existing tests
that send such requests.

apache#68100 (merged two minutes later) added
MetaServiceTest.GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld. Its
injected aggregation of [1, 2] has no output rowset at version 2, so on master
the replacement is skipped as obsolete. The restarted read then returns the old
three-chunk bitmap, the byte threshold stops the read before
following_rowset, and the first iteration fails:

    cloud/test/meta_service_test.cpp:8501: Failure
    Expected equality of these values:
      get_res.rowset_ids_size()
        Which is: 3
      expected_bitmap_count
        Which is: 4
    Google Test trace:
    cloud/test/meta_service_test.cpp:8382: replacement_size=1

Because of the ASSERT, the second iteration (replacement_size =
3 * DEFAULT_BLOB_SPLIT_SIZE) never runs. meta_service_test then exits
non-zero, so since 2026-10-20 11:16 +08:00 the Cloud UT pipeline fails for
every PR, whatever it changes. The same test passed on the branch-4.2 pick of
apache#68100 (apache#69307), which does not have apache#68084.

Add the output rowset, as apache#68084 did for the other aggregation tests, so the
test exercises the replacement it was written for. Only that check reads the
new rowset meta; get_delete_bitmap does not read rowset metas.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - In a Linux arm64 container (Debian 12, ldb toolchain v0.25, the
      linux-aarch64 prebuilt third-party tree, a local FDB 7.1.57), with
      `run-cloud-ut.sh --run`:
        - on this branch, rebased onto master 33c460d, meta_service_test
          passes all 280 cases that run, this one included;
        - before the rebase, on master 1d03523, the whole cloud UT
          passes except StopWatchTest.SimpleTest, which does not involve this
          change: it allows 500 us of oversleep over two 1 ms sleeps, and in
          that VM a 1 ms sleep often takes about 1.3 ms;
        - with the added line removed, the test fails as on the pipeline:
          3 rowset ids instead of 4, under the trace replacement_size=1.
    - clang-format 16 reports no changes.
- Behavior changed: No
- Does this need documentation: No

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@liaoxin01 liaoxin01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@morningman

Copy link
Copy Markdown
Contributor Author

run cloudut

@morningman

Copy link
Copy Markdown
Contributor Author

skip buildall

@morningman
morningman merged commit 07887d2 into apache:master Oct 20, 2026
41 of 46 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 21, 2026
…eplacement test (#69349)

### What problem does this PR solve?

Issue Number: None

Related PR: #68084, #68100

Problem Summary:

**In short**


`MetaServiceTest.GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld`
has failed on master since #68084 and #68100 were merged two minutes
apart on 2026-10-20, so the Cloud UT pipeline is red for every PR. The
test, added by #68100, injects a compaction aggregation without the
output rowset that #68084 started to require, so the meta service skips
the aggregation as obsolete. This PR adds that rowset to the test, the
way #68084 did for the other aggregation tests. It changes one line of a
test and no meta service code.

**Background**

- A compaction that aggregates the delete bitmaps of versions [start,
end] sends `update_delete_bitmap` with `lock_id = -3`, `without_lock`,
and `pre_rowset_agg_start_version` / `pre_rowset_agg_end_version`.
- #68084 makes the meta service check, in every transaction, that the
output rowset of such an aggregation still exists: the rowset meta at
the end version must exist and cover [start, end]. Otherwise the request
is treated as obsolete and returns OK without writing anything. #68084
added that output rowset (`put_delete_bitmap_test_rowset(..., 2, "r1-2",
1)`) to the existing tests that send such requests.
- #68100 added
`GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld`. While
`get_delete_bitmap` reads a bitmap across several transactions, a sync
point injects an aggregation of [1, 2] and makes the read restart with
`TXN_TOO_OLD`; the test checks that the restarted read returns the
complete replacement. It was written against a master without #68084.

**The problem, and what it cost**

- With #68084, the injected aggregation has no output rowset at version
2, so `check_pre_rowset_aggregation` skips it. The restarted read
returns the old three-chunk bitmap, the byte threshold stops it before
`following_rowset`, and the first iteration fails:

```
cloud/test/meta_service_test.cpp:8501: Failure
Expected equality of these values:
  get_res.rowset_ids_size()
    Which is: 3
  expected_bitmap_count
    Which is: 4
Google Test trace:
cloud/test/meta_service_test.cpp:8382: replacement_size=1
```

- The ASSERT ends the test, so the second iteration (`replacement_size =
3 * DEFAULT_BLOB_SPLIT_SIZE`) never runs. `meta_service_test` exits
non-zero, and since 2026-10-20 11:16 +08:00 the Cloud UT pipeline has
failed for every PR, whatever the PR changes.
- branch-4.2 already has the pick of #68100 (#69307). Once the pick of
#68084 (#69306) is merged, branch-4.2 fails the same way.

**How this PR fixes it**

Add the output rowset of the injected aggregation to the test, as #68084
did for the other aggregation tests:

```cpp
put_delete_bitmap_test_rowset(meta_service.get(), instance_id, tablet_id, 2, "r1-2", 1);
```

With it, the check passes, the replacement is written, and the test
exercises the restarted read it was written for. Only that check reads
the new rowset meta; `get_delete_bitmap` does not read rowset metas, so
nothing else in the test changes.

**Results**

`run-cloud-ut.sh --run` in a Linux arm64 container (Debian 12, ldb
toolchain v0.25, the linux-aarch64 prebuilt third-party tree, a local
FDB 7.1.57):

| Run, on master `33c460d7365` |
`GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld` | Other tests
|
|---|---|---|
| without this PR (the added line removed) | fails as on the pipeline: 3
rowset ids instead of 4, under `replacement_size=1` | not run |
| with this PR | passes | all 33 test binaries pass except
`StopWatchTest.SimpleTest` |

The same two runs on master `1d03523339f`, before the rebase, gave the
same results.

**Classes, and how they call each other**

```
MetaServiceTest.GetDeleteBitmapReturnsCompleteReplacementAfterTxnTooOld
 ├─ put_delete_bitmap_test_rowset(version 1, rowset_id)
 ├─ put_delete_bitmap_test_rowset(version 2, "r1-2", start 1)       <- added
 └─ MetaServiceImpl::get_delete_bitmap
      └─ sync point "get_delete_bitmap_err" (in the middle of the read)
           ├─ MetaServiceImpl::update_delete_bitmap(lock_id -3, aggregation [1, 2])
           │    └─ check_pre_rowset_aggregation: the rowset meta at version 2 must cover [1, 2]
           └─ TXN_TOO_OLD -> get_delete_bitmap restarts the read
```

Nothing outside `cloud/test/meta_service_test.cpp` changes.

**Merge order**

No dependency on master. On branch-4.2 this should go in together with
#69306 (the pick of #68084), or right after it.
yiguolei pushed a commit that referenced this pull request Oct 24, 2026
…ete bitmap replacement test #69349 (#69357)

Cherry-picked from #69349

---------

Co-authored-by: Mingyu Chen (Rayner) <[email protected]>
Co-authored-by: Gavin Chou <[email protected]>
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.

4 participants