yinzhijian opened a new pull request, #17329:
URL: https://github.com/apache/doris/pull/17329

   # Proposed changes
   
   
   ## Problem summary
   
   大体逻辑沿用#9172
   
   ### 关键改动点:
   1. 
FE的nodename从ip_port_timestamp改为hostname_port_timestamp,如下图中的fe3就是这个实例在k8s中的域名:<img
 width="468" alt="image" 
src="https://user-images.githubusercontent.com/3899678/215979268-9be561be-9546-4ca3-a138-f9ce14936b49.png";>
   
**原因**:为了避免IP变更后,其它FE实例的IP使用了该IP,比如FE3的原始IP为172.18.0.4,动态变更为172.18.0.50,而后新增了一个FE4,它的IP为172.18.0.4,这时如果还使用ip_port_timestamp形式,则无法直观的从name中区分彼此。
   **风险点**:可能影响依赖Name解析ip、port的外部程序,无法识别正确的IP。
   
   2. FDQNManager定期便利所有的FE,检查域名对应的IP是否已经改变,如果改变:
   2.1 
~~通过BDBHA的updateAddress方法通知所有peers,保证bdbje层面的一致性。~~【现在直接以域名作为BDBJE的address,不需要更改IP时再更新】
   2.2 改变master自身内存记录的IP
   2.3 通过editlog同步给其它FE,改变其它follower内存中记录的FE ip信息。
   3.  Frontend的meta持久化方式改为了json格式,方便后续字段的变更。
   4. deploy manger K8s支持IP变更(delete pod后stateful自动加回,ip跟原始的不一致)
   
   ### Changes:
   
   1. The nodename of FE changes from ip_port_timestamp to 
hostname_port_timestamp, as shown in the following figure, fe3 is the hostname 
of this instance in k8s:
   <img width="468" alt="image" 
src="https://user-images.githubusercontent.com/3899678/215979268-9be561be-9546-4ca3-a138-f9ce14936b49.png";>
   
   **Reason**: To avoid the scenario that other FE instances use the changed IP 
after IP change, for example, the original IP of FE3 is 172.18.0.4, changed 
dynamically to 172.18.0.50, and later a new FE4 is added with IP 172.18.0.4, if 
the ip_port_timestamp form is still used, the existing program cannot 
distinguish each other from the name.
   
   **Risk**: The external program that relies on Name resolution for IP and 
port recognition may be affected and cannot recognize the correct IP.
   
   2. FDQNManager regularly visits all FEs to check if the IP corresponding to 
the hostname has changed. If changed:
   2.1 Notify all peers through the updateAddress method of BDBHA to ensure 
consistency at the bdbje level.
   2.2 Change the IP information recorded in memory by the master itself
   2.3 Synchronize to other FEs through the editlog to change the IP 
information recorded in memory by other followers.
   3. The persistence method of Frontend meta is changed to json format for 
ease of future field changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [x] Yes
       - [ ] No
       - [ ] I don't know
   5. Has unit tests been added:
       - [x] Yes
       - [ ] No
       - [ ] No Need
   6. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [x] No Need
   7. Does it need to update dependencies:
       - [ ] Yes
       - [x] No
   8. Are there any changes that cannot be rolled back:
       - [x] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to