You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "hudi-bot (via GitHub)" <gi...@apache.org> on 2025/11/30 08:26:54 UTC

[I] Two log compaction instants can be scheduled at the same time [hudi]

hudi-bot opened a new issue, #16101:
URL: https://github.com/apache/hudi/issues/16101

   It is possble to schedule two log compactions at the same time. Ideally the second schedule should fail.
   {code:java}
   total 72 -rw-r--r-- 1 ljain staff 2915 Jul 14 16:08 20230714160833786.deltacommit -rw-r--r-- 1 ljain staff 1519 Jul 14 16:08 20230714160833786.deltacommit.inflight -rw-r--r-- 1 ljain staff 0 Jul 14 16:08 20230714160833786.deltacommit.requested -rw-r--r-- 1 ljain staff 2987 Jul 14 16:08 20230714160846796.deltacommit -rw-r--r-- 1 ljain staff 1531 Jul 14 16:08 20230714160846796.deltacommit.inflight -rw-r--r-- 1 ljain staff 0 Jul 14 16:08 20230714160846796.deltacommit.requested -rw-r--r-- 1 ljain staff 3058 Jul 14 16:08 20230714160849913.deltacommit -rw-r--r-- 1 ljain staff 1531 Jul 14 16:08 20230714160849913.deltacommit.inflight -rw-r--r-- 1 ljain staff 0 Jul 14 16:08 20230714160849913.deltacommit.requested -rw-r--r-- 1 ljain staff 0 Jul 14 16:08 20230714160852571.logcompaction.inflight -rw-r--r-- 1 ljain staff 2610 Jul 14 16:08 20230714160852571.logcompaction.requested -rw-r--r-- 1 ljain staff 2610 Jul 14 16:08 20230714160853000.logcompaction.requested
   {code}
    
   
   ## JIRA info
   
   - Link: https://issues.apache.org/jira/browse/HUDI-6548
   - Type: Bug
   
   
   ---
   
   
   ## Comments
   
   17/Jul/23 18:30;shivnarayan;sorry, can you elaborate on the actual sequence. the log excerpt is not very clear on what exactly we are testing or what are the sequence of events. 
   
    
   
   can you write down the below:
    * whats the scenario we are testing.
    * how did we test the actual scenario
    * whats the expected behavior
    * what do we actually see. 
   
    ;;;
   
   ---
   
   18/Jul/23 04:13;ljain;The scenario is - If I call scheduleLogCompaction twice, it is creating two different requested instants for log compaction.
   {code:java}
   client.scheduleLogCompaction(Option.empty());
   client.scheduleLogCompaction(Option.empty()); {code}
   {code:java}
   -rw-r--r--  1 ljain  staff  2977 Jul 18 09:41 20230718094102735.logcompaction.requested 
   -rw-r--r--  1 ljain  staff  2977 Jul 18 09:41 20230718094103112.logcompaction.requested
   {code}
   I expect the second schedule to fail.;;;
   
   ---
   
   18/Jul/23 09:01;ljain;The issue doesn't occur if I use the scheduleCompaction API twice. That only creates one requested compaction instant. Therefore this seems like a valid bug.
   
    ;;;


-- 
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-unsubscribe@hudi.apache.org.apache.org

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


Re: [I] Two log compaction instants can be scheduled at the same time [hudi]

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan closed issue #16101: Two log compaction instants can be scheduled at the same time
URL: https://github.com/apache/hudi/issues/16101


-- 
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-unsubscribe@hudi.apache.org

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


Re: [I] Two log compaction instants can be scheduled at the same time [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on issue #16101:
URL: https://github.com/apache/hudi/issues/16101#issuecomment-3630126027

   ### Linked PR(s)
   
   - https://github.com/apache/hudi/pull/9246


-- 
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-unsubscribe@hudi.apache.org

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


Re: [I] Two log compaction instants can be scheduled at the same time [hudi]

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on issue #16101:
URL: https://github.com/apache/hudi/issues/16101#issuecomment-4795534328

   This appears to be fixed on current `master`.
   
   The scheduling path now guarantees that two log-compaction instants cannot be scheduled for the same set of file groups:
   
   1. `BaseHoodieTableServiceClient.scheduleTableServiceInternal` (`hudi-client-common/.../BaseHoodieTableServiceClient.java`) creates a fresh `HoodieTable` (with a fresh file-system view) **inside** the state-change lock. The lock around instant creation + plan generation was tightened by [HUDI-9389 / #13340](https://github.com/apache/hudi/commit/4284012d2b5deefc2341ae8aac711d8525689fe2), eliminating concurrent-scheduler races.
   2. `HoodieLogCompactionPlanGenerator.filterLogCompactionOperations()` returns `true`, so `BaseHoodieCompactionPlanGenerator.generateCompactionPlan` excludes file groups already in pending log compaction via `fileSystemView.getPendingLogCompactionOperations()`.
   3. `ScheduleCompactionActionExecutor.execute()` only calls `saveToLogCompactionRequested` when the resulting plan has non-empty operations — so the second `scheduleLogCompaction()` call returns `Option.empty()` without writing a second `.logcompaction.requested` file.
   
   Could you confirm with a quick repro on current `master`? If you can still reproduce, please share the table config (especially `hoodie.log.compaction.blocks.threshold`, write concurrency mode) and the exact client setup so we can dig further. Otherwise this issue can likely be closed.


-- 
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-unsubscribe@hudi.apache.org

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