lordcheng10 opened a new pull request, #17035: URL: https://github.com/apache/pulsar/pull/17035
### Motivation We modified some cache dynamic configurations, such as: managedLedgerCacheSizeMB=100, but after we restarted the broker, we found that the dynamically modified cache configuration was invalid, and the value configured in broker.conf took effect. After restarting, the loading process of config is as follows: 1. Load the broker.conf file and initialize the ServiceConfiguration object; 2. Use the ServiceConfiguration object to build the ManagedLedgerStorage object: https://github.com/apache/pulsar/blob/4b757cf9f9046c7143329156b1009fe43217eaea/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java#L742~L746 3. When creating the BrokerService object, it will read the dynamic configuration on zookeeper, update it to conf, and then register the listener for the relevant configuration update, but the execution of these listeners is not triggered: https://github.com/apache/pulsar/blob/4b757cf9f9046c7143329156b1009fe43217eaea/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java#L746~L748 https://github.com/apache/pulsar/blob/4b757cf9f9046c7143329156b1009fe43217eaea/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L2205~L2250 Therefore, after the broker is restarted, the cache-related configuration used is still the configuration in the broker.conf file. Solution: The listeners that load and trigger related configuration updates are loaded in the following order: 1. Register and configure the listener; 2. Read the dynamic configuration on zookeeper and trigger the corresponding listener; ### Documentation Check the box below or label this PR directly. Need to update docs? - [ ] `doc-required` (Your PR needs to update docs and you will update later) - [x] `doc-not-needed` (Please explain why) - [ ] `doc` (Your PR contains doc changes) - [ ] `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]
