Dynamic changes of listeners will lead into out of sync. Our operation is as following:
- Broker is started and listening on a ip-address.
- Create some topics.
- Change listening to a domain name via dynamic-configuration for some reason.
- Create some new topics.
- Produce message into any older topics.
- All topics, produced in step 5, are out of sync.
Following is major logs：
After read source code. We found following code in AbstractFetcherManager:
As marked code defined, if sourceBroker is changed, in our case, the older fetcher thread will be shutdown and a new fetcher thread will be created using new sourceBroker. In this way, all of the fetched partitions in older fetcher thread will be lost.