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

Filter out tombstone segments from metadata cache #16890

Merged
merged 18 commits into from
Aug 20, 2024

Conversation

findingrish
Copy link
Contributor

@findingrish findingrish commented Aug 13, 2024

Broker attempts to continuously refresh tombstone segments due to missing metadata (due to a limitation with segment metadata queries, see: #12137).

This PR resolves the issue by preventing tombstone segments from being added to the metadata cache.

Related to #14989

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@@ -2214,6 +2215,77 @@ protected void coldDatasourceSchemaExec()
Assert.assertEquals(0, latch.getCount());
}

@Test
public void testTombstoneSegmentIsNotAdded() throws InterruptedException
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This test case is very similar to BSMC#testTombstoneSegmentIsNotAdded(). Can we do a bit of refactor to remove redundancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test is trying ensure that tombstone segments are not added to the Broker and Coordinator cache instances.
Refactoring the test wouldn't be very beneficial since,

  • Timeline used in the two caches is different.
  • org.apache.druid.segment.metadata.AbstractSegmentMetadataCache#getSegmentMetadataSnapshot implementation differs between the two instances.

@cryptoe cryptoe merged commit bc4b3a2 into apache:master Aug 20, 2024
88 of 90 checks passed
hevansDev pushed a commit to hevansDev/druid that referenced this pull request Aug 29, 2024
* Fix build

* Support segment metadata queries for tombstones

* Filter out tombstone segments from metadata cache

* Revert some changes

* checkstyle

* Update docs
cryptoe pushed a commit that referenced this pull request Sep 13, 2024
This PR #16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
findingrish added a commit to findingrish/druid that referenced this pull request Sep 16, 2024
This PR apache#16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
findingrish added a commit to findingrish/druid that referenced this pull request Sep 16, 2024
This PR apache#16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
pranavbhole pushed a commit to pranavbhole/druid that referenced this pull request Sep 17, 2024
This PR apache#16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
findingrish added a commit to findingrish/druid that referenced this pull request Sep 19, 2024
This PR apache#16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
abhishekagarwal87 pushed a commit that referenced this pull request Sep 19, 2024
This PR #16890 introduced a change to skip adding tombstone segments to the cache.
It turns out that as a side effect tombstone segments appear unavailable in the console. This happens because availability of a segment in Broker is determined from the metadata cache.

The fix is to keep the segment in the metadata cache but skip them from refresh.

This doesn't affect any functionality as metadata query for tombstone returns empty causing continuous refresh of those segments.
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
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.

3 participants