MarcosZyk opened a new pull request, #11546:
URL: https://github.com/apache/iotdb/pull/11546

   ## Description
   
   
   ### Motivation
   In the original implementation, the attribute modification is not protected 
by the read lock, therefore a node already in buffer may experience redundant 
flush while the updated info may already be synced to disk.
   
   Here's a simple example. 
   
   MNode A is already in buffer since it may be newly added to MTree or 
recently updated. 
   
   Thread A tries to modify some attribute in it while the flush thread starts 
a flush process and take the write lock in advance. 
   
   In this case, the modified info will be synced to disk by this flush 
process, but thread A may still invoke the updateMNode method to add the node 
to buffer after this flush. 
   
   The result is a node with nothing new will experience another flush process.
   
   ### Modification
   
   Refactor the updateMNode method to require the invokers to pass the specific 
update process as a consumer, which will be protected by read lock.
   
   
   
   


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