codelipenghui opened a new pull request, #21095: URL: https://github.com/apache/pulsar/pull/21095
### Motivation https://github.com/apache/pulsar/pull/14154 introduced a metadata cache expiration policy to avoid a potential memory leak in the Metadata caches. But it uses the `expireAfterWrite` to force expire the caches no matter if the entry has been actively accessed or not. We also found another related regression from 2.9 to 2.10. The BookKeeper placement policy doesn't work as expected if the cache expires. The code itself also has the problem, but without the `expireAfterWrite`, it works great. https://github.com/apache/pulsar/blob/b69f4efa6058c3f51885a61a2b3acb46f8b730f4/pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java#L189-L198 For most cases, disabling the `expireAfterWrite` and enabling `expireAfterAccess` will resolve the issue because the new ledgers will happen more frequently than 10 mins if have some topics. ### Does this pull request potentially affect one of the following parts: <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> *If the box was checked, please highlight the changes* - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
