Skip to content
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

TestLogCopySetsCloseTimestampInFooter unit test failing with high frequency #24518

Closed
1 task done
agsh-yb opened this issue Oct 18, 2024 · 0 comments
Closed
1 task done
Assignees
Labels

Comments

@agsh-yb
Copy link
Contributor

agsh-yb commented Oct 18, 2024

Jira Link: DB-13553

Description

TabletSplitITest.TestLogCopySetsCloseTimestampInFooter starts failing recently on alma8-clang17-release-aarch64 Analyze_trend with flakiness

../../src/yb/integration-tests/tablet-split-itest.cc:966 Expected equality of these values:   has_replicated_entries     Which is: false   segment->footer().has_close_timestamp_micros()     Which is: true T d56728bc9fd04f1fa976653786bb78a1 P 745637836d2b45fbbd3344379de6bc09: Expected valid close timestamp for segment with replicated entries.



Expected equality of these values:
  has_replicated_entries
    Which is: false
  segment->footer().has_close_timestamp_micros()
    Which is: true
T d56728bc9fd04f1fa976653786bb78a1 P 745637836d2b45fbbd3344379de6bc09: Expected valid close timestamp for segment with replicated entries.

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@agsh-yb agsh-yb added area/documentation Documentation needed QA QA filed bugs area/unittest tracking platform unit test related issues status/awaiting-triage Issue awaiting triage labels Oct 18, 2024
@rthallamko3 rthallamko3 added area/docdb YugabyteDB core features and removed status/awaiting-triage Issue awaiting triage area/documentation Documentation needed labels Oct 18, 2024
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue and removed area/unittest tracking platform unit test related issues labels Oct 18, 2024
@rthallamko3 rthallamko3 added kind/bug This issue is a bug and removed kind/enhancement This is an enhancement of an existing feature labels Oct 18, 2024
basavaraj29 added a commit that referenced this issue Nov 5, 2024
…mpInFooter

Summary:
Test `TabletSplitITest.TestLogCopySetsCloseTimestampInFooter` was put up to assert that the footer timestamp was being rightly set for log segments when duplicating the segment for a split child tablet.

The test was trying to make the following assertion
```
      for (const auto& entry : entries_copy_result.entries) {
        if (entry->has_replicate()) {
          has_replicated_entries = true;
          break;
        }
      }
      ASSERT_EQ(has_replicated_entries, segment->footer().has_close_timestamp_micros())
          << "T " << peer->tablet_id() << " P " << peer->permanent_uuid()
          << ": Expected valid close timestamp for segment with replicated entries.";
    }
```
where we assert that the segment would have a valid footer timestamp only when the `segment->HasFooter()` and the segment has non-zero replicate entries. But from the code, we can see that there exists cases where a segment has a valid footer and has 0 replicate entries
```
  if (!footer_builder_.has_min_replicate_index()) {
    VLOG_WITH_PREFIX(1) << "Writing a segment without any REPLICATE message. Segment: "
                        << active_segment_->path();
  }
```
Additionally, detective failure logs confirm this to be the case
```
../../src/yb/integration-tests/tablet-split-itest.cc:966: Failure
Expected equality of these values:
  has_replicated_entries
    Which is: false
  segment->footer().has_close_timestamp_micros()
    Which is: true
```

The diff fixes the test issue by asserting that the log segment has a valid footer close timestamp when `segment->HasFooter()` is true. This assertion should hold since the footer should always have a valid close timestamp.
Jira: DB-13553

Test Plan:
Jenkins: compile-only

./yb_build.sh release --cxx-test='TEST_F(TabletSplitITest, TestLogCopySetsCloseTimestampInFooter) {' -n 50 --tp 1

Note: The modified test rightly fails when source code changes fixing #23335 are reverted, which is the required behavior.

Reviewers: timur, rthallam

Reviewed By: timur

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D39615
basavaraj29 added a commit that referenced this issue Nov 5, 2024
…ySetsCloseTimestampInFooter

Summary:
Original commit: 4785122 / D39615
Test `TabletSplitITest.TestLogCopySetsCloseTimestampInFooter` was put up to assert that the footer timestamp was being rightly set for log segments when duplicating the segment for a split child tablet.

The test was trying to make the following assertion
```
      for (const auto& entry : entries_copy_result.entries) {
        if (entry->has_replicate()) {
          has_replicated_entries = true;
          break;
        }
      }
      ASSERT_EQ(has_replicated_entries, segment->footer().has_close_timestamp_micros())
          << "T " << peer->tablet_id() << " P " << peer->permanent_uuid()
          << ": Expected valid close timestamp for segment with replicated entries.";
    }
```
where we assert that the segment would have a valid footer timestamp only when the `segment->HasFooter()` and the segment has non-zero replicate entries. But from the code, we can see that there exists cases where a segment has a valid footer and has 0 replicate entries
```
  if (!footer_builder_.has_min_replicate_index()) {
    VLOG_WITH_PREFIX(1) << "Writing a segment without any REPLICATE message. Segment: "
                        << active_segment_->path();
  }
```
Additionally, detective failure logs confirm this to be the case
```
../../src/yb/integration-tests/tablet-split-itest.cc:966: Failure
Expected equality of these values:
  has_replicated_entries
    Which is: false
  segment->footer().has_close_timestamp_micros()
    Which is: true
```

The diff fixes the test issue by asserting that the log segment has a valid footer close timestamp when `segment->HasFooter()` is true. This assertion should hold since the footer should always have a valid close timestamp.
Jira: DB-13553

Test Plan:
Jenkins: compile-only

./yb_build.sh release --cxx-test='TEST_F(TabletSplitITest, TestLogCopySetsCloseTimestampInFooter) {' -n 50 --tp 1

Note: The modified test rightly fails when source code changes fixing #23335 are reverted, which is the required behavior.

Reviewers: timur, rthallam

Reviewed By: rthallam

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D39731
basavaraj29 added a commit that referenced this issue Nov 5, 2024
…ySetsCloseTimestampInFooter

Summary:
Original commit: 4785122 / D39615
Test `TabletSplitITest.TestLogCopySetsCloseTimestampInFooter` was put up to assert that the footer timestamp was being rightly set for log segments when duplicating the segment for a split child tablet.

The test was trying to make the following assertion
```
      for (const auto& entry : entries_copy_result.entries) {
        if (entry->has_replicate()) {
          has_replicated_entries = true;
          break;
        }
      }
      ASSERT_EQ(has_replicated_entries, segment->footer().has_close_timestamp_micros())
          << "T " << peer->tablet_id() << " P " << peer->permanent_uuid()
          << ": Expected valid close timestamp for segment with replicated entries.";
    }
```
where we assert that the segment would have a valid footer timestamp only when the `segment->HasFooter()` and the segment has non-zero replicate entries. But from the code, we can see that there exists cases where a segment has a valid footer and has 0 replicate entries
```
  if (!footer_builder_.has_min_replicate_index()) {
    VLOG_WITH_PREFIX(1) << "Writing a segment without any REPLICATE message. Segment: "
                        << active_segment_->path();
  }
```
Additionally, detective failure logs confirm this to be the case
```
../../src/yb/integration-tests/tablet-split-itest.cc:966: Failure
Expected equality of these values:
  has_replicated_entries
    Which is: false
  segment->footer().has_close_timestamp_micros()
    Which is: true
```

The diff fixes the test issue by asserting that the log segment has a valid footer close timestamp when `segment->HasFooter()` is true. This assertion should hold since the footer should always have a valid close timestamp.
Jira: DB-13553

Test Plan:
Jenkins: compile-only

./yb_build.sh release --cxx-test='TEST_F(TabletSplitITest, TestLogCopySetsCloseTimestampInFooter) {' -n 50 --tp 1

Note: The modified test rightly fails when source code changes fixing #23335 are reverted, which is the required behavior.

Reviewers: timur, rthallam

Reviewed By: rthallam

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D39732
basavaraj29 added a commit that referenced this issue Nov 5, 2024
…etsCloseTimestampInFooter

Summary:
Original commit: 4785122 / D39615
Test `TabletSplitITest.TestLogCopySetsCloseTimestampInFooter` was put up to assert that the footer timestamp was being rightly set for log segments when duplicating the segment for a split child tablet.

The test was trying to make the following assertion
```
      for (const auto& entry : entries_copy_result.entries) {
        if (entry->has_replicate()) {
          has_replicated_entries = true;
          break;
        }
      }
      ASSERT_EQ(has_replicated_entries, segment->footer().has_close_timestamp_micros())
          << "T " << peer->tablet_id() << " P " << peer->permanent_uuid()
          << ": Expected valid close timestamp for segment with replicated entries.";
    }
```
where we assert that the segment would have a valid footer timestamp only when the `segment->HasFooter()` and the segment has non-zero replicate entries. But from the code, we can see that there exists cases where a segment has a valid footer and has 0 replicate entries
```
  if (!footer_builder_.has_min_replicate_index()) {
    VLOG_WITH_PREFIX(1) << "Writing a segment without any REPLICATE message. Segment: "
                        << active_segment_->path();
  }
```
Additionally, detective failure logs confirm this to be the case
```
../../src/yb/integration-tests/tablet-split-itest.cc:966: Failure
Expected equality of these values:
  has_replicated_entries
    Which is: false
  segment->footer().has_close_timestamp_micros()
    Which is: true
```

The diff fixes the test issue by asserting that the log segment has a valid footer close timestamp when `segment->HasFooter()` is true. This assertion should hold since the footer should always have a valid close timestamp.
Jira: DB-13553

Test Plan:
Jenkins: compile-only

./yb_build.sh release --cxx-test='TEST_F(TabletSplitITest, TestLogCopySetsCloseTimestampInFooter) {' -n 50 --tp 1

Note: The modified test rightly fails when source code changes fixing #23335 are reverted, which is the required behavior.

Reviewers: timur, rthallam

Reviewed By: rthallam

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D39733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants