Caideyipi commented on code in PR #12355:
URL: https://github.com/apache/iotdb/pull/12355#discussion_r1609461227


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/runtime/PipeDataNodeRuntimeAgent.java:
##########
@@ -153,24 +161,28 @@ public void 
assignProgressIndexForTsFileLoad(TsFileResource tsFileResource) {
   }
 
   public RecoverProgressIndex getNextProgressIndexForTsFileLoad() {
+    // The data node id must be negative. Because in the consensus layer Pipe, 
the processor of the
+    // pipe task will filter the progress index of the event. Leaving the 
recover progress index
+    // containing the datanode id of the datanode where the pipe task is 
located. The tsfile loaded
+    // in cannot be filtered by the processor of the datanode where the pipe 
task is located,
+    // because the load directly sends the tsfile to all replicas. Therefore, 
it is necessary to
+    // ensure that the datanode id generated by the load is negative.
     return new RecoverProgressIndex(
-        DATA_NODE_ID,
-        
simpleConsensusProgressIndexAssigner.getSimpleProgressIndexForTsFileRecovery());
+        -DATA_NODE_ID, simpleProgressIndexAssigner.getSimpleProgressIndex());
   }
 
   ////////////////////// Recover ProgressIndex Assigner //////////////////////
 
   public void assignProgressIndexForTsFileRecovery(TsFileResource 
tsFileResource) {
     tsFileResource.updateProgressIndex(
         new RecoverProgressIndex(
-            DATA_NODE_ID,
-            
simpleConsensusProgressIndexAssigner.getSimpleProgressIndexForTsFileRecovery()));
+            DATA_NODE_ID, 
simpleProgressIndexAssigner.getSimpleProgressIndex()));

Review Comment:
   This may together be negative.



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

Reply via email to