devmadhuu commented on code in PR #11762:
URL: https://github.com/apache/ozone/pull/11762#discussion_r4378740033


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperHelper.java:
##########
@@ -265,8 +265,7 @@ public static boolean process(OMUpdateEventBatch events,
 
         case UPDATE:
           if (omdbUpdateEvent.getOldValue() != null) {
-            handleDeleteOMKeyEvent(
-                omdbUpdateEvent.getOldValue().getKeyName(), 
localContainerKeyMap,
+            handleDeleteOMKeyEvent(updatedKey, localContainerKeyMap,

Review Comment:
   Could we also coordinate the container key count updates between the FSO and 
OBS tasks because both can run concurrently.
   
   With this change, an UPDATE removes and re-adds the existing mappings even 
when only the key’s metadata changes and its blocks remain in the same 
containers.
   
   The two tasks can run at the same time. Each calculates counts in its own 
temporary map and later writes those numbers to the shared database. This 
allows the following sequence:
   
   Container 1 contains key A, with a saved count of 1.
   The FSO task processes a metadata-only update of A and reads that count.
   The OBS task adds key B to the same container and saves count 2.
   The FSO task finishes its remove-and-add calculation, 1 → 0 → 1, and saves 
1, overwriting the correct count.
   
   Both key mappings then exist, but the saved count is 1 instead of 2. A local 
reproduction using real Recon database tables produced this result with the PR; 
the same scenario retained the correct count with the parent implementation.
   
   Could we protect the complete count read/update/write operation across both 
tasks, or safely combine their count changes? Please also add a test that runs 
FSO and OBS updates together for a shared container. The new tests exercise 
each layout separately, so they do not cover this case.



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