Could you give more details about your method? I will try to make it work.
Silently prioritizing the dynamic port and removing the conflicting static port to solve the inconsistency may be a surprise to the user.
As we discussed before, what happened in reconfig client port is that if there is client port in static file, it is gonna remove that one from static file too. But my worry is that this requires much consideration on consistency in removing the line and updating the dynamic file.
So my plan is that:
1. Keep the client port on fresh boot for backward compatibility.
Then what happens if the server reconfig itself client port? Well, I plan for two tasks, where the second task is gonna replace the first one finally.
2.1 Since it will updates the client port in dynamic file, making a preference on dynamic file over static file is a hackish way to finish it. Not delete/remove here. This would be quick and make out a release. This is part of ZOOKEEPRE-1993
2.2 (This one is difficult and I need more time to get through the code.) Basically, on reconfiguring the client port on itself, it should safely remove the client port, update the dynamic file. This is part of ZOOKEEPRE-1995
Does that make sense? Please let me know what you think might be proper solution.