Remove unused extents from tablet locator - #6498
Conversation
dlmarion
left a comment
There was a problem hiding this comment.
I think we may want synchronous notification and locking to remove the chance of a race condition between expiration and lookup.
dlmarion
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I think this is a good idea. Working on that now
|
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. |
|
08243c5 adds cache expiration to LocatorKey so clients with different settings get separate locators. |
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.