Skip to content

Remove unused extents from tablet locator - #6498

Open
DomGarguilo wants to merge 8 commits into
apache:2.1from
DomGarguilo:removeExtents
Open

Remove unused extents from tablet locator#6498
DomGarguilo wants to merge 8 commits into
apache:2.1from
DomGarguilo:removeExtents

Conversation

@DomGarguilo

@DomGarguilo DomGarguilo commented Aug 10, 2026

Copy link
Copy Markdown
Member

fixes #6169

Adds a cache to the online tablet locator that expires tablet extents after 10 minutes. Expired locations are reloaded from metadata when needed.

This reduces client memory usage.

@DomGarguilo DomGarguilo added this to the 2.1.7 milestone Aug 10, 2026
@DomGarguilo DomGarguilo self-assigned this Aug 10, 2026
@DomGarguilo DomGarguilo linked an issue Aug 10, 2026 that may be closed by this pull request
Comment thread core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java Outdated
Comment thread core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java Outdated

@dlmarion dlmarion 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.

I think we may want synchronous notification and locking to remove the chance of a race condition between expiration and lookup.

Comment thread core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocatorImpl.java Outdated

@dlmarion dlmarion 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.

Thinking we may want to make this feature disabled by default and allow users to opt-in. This will allow them to test the behavior in their environments with their applications.

public class TabletLocatorImpl extends TabletLocator {

private static final Logger log = LoggerFactory.getLogger(TabletLocatorImpl.class);
private static final Duration CACHE_EXPIRATION = Duration.ofMinutes(10);

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.

Given that this is being introduced after the 6th 2.1 patch release, we may want to preserve the old behavior by default and add a client property that enables this. Could add a property for the client extent cache expiration, default value of 0 which disables this feature.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this is a good idea. Working on that now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added in 44dff5d

@DomGarguilo

Copy link
Copy Markdown
Member Author

I think only the client that was created first will have its value used for the new cache expiration property. Since locators are only keyed off of instance and table. I think I need to add the cache expiration value to the Locator and its .equals()/hash() so each client with a unique instance+table+cache expiration will create/share the correct locator.

@DomGarguilo

Copy link
Copy Markdown
Member Author

08243c5 adds cache expiration to LocatorKey so clients with different settings get separate locators.

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.

Remove unused extents from tablet locator

3 participants