neuyilan commented on PR #25784:
URL: https://github.com/apache/doris/pull/25784#issuecomment-1776431981

   > 好问题。
   > 
   > 这里并发更新是会存在问题的。但锁的范围需要更改。 fe 修改table的数据时,包括修改replica state、增删 
replica等,都是要拿到table 锁的。所以,这里,在ReportHandler::deleteFromMeta 以及 finishCloneTask 
里对单个table的replica修改是原子操作的(用olapTable.writeLockIfExist 来保证);
   > 
   > 这里的一个并发问题是:
   > 
   > 1. BE 上报一个stale tablet report,该report 不含clone tablet;
   > 2. fe add clone replica && be clone tablet 完成,接着fe更新replica 为normal状态;
   > 3. fe 处理步骤1的stale tablet report,由于该tablet 状态为normal,且stale tablet report 
不含该tablet,fe会把BE的该tablet给删除;
   > 
   > 一种修改思路:BE 上报finish clone new tablet时,把 _s_report_version 带上来;而 
fe在finishCloneTablet时,用它来更新backend的report version,从而在上面的步骤3时,会丢弃该 stale 
report;但还有更多的步骤,在deleteFromMeta中的每个replica时,都应该检查一下该report对应的_s_report_version 
。因为deleteFromMeta 
可能执行时间很久,在deleteFromMeta处理的不同的tablet时,穿插进来新的finishCloneTask会更新backend report 
version, 从而出现同一个tablets report消息, 先处理的tablet是正常的,后处理的tablet是report version 落后的情况
   
   Yes, you're right, thanks for your advice, I'll change the PR later.


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to