Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #59848

Related PR: introduced by #56921

Problem Summary:

fix concurrency bug when dynamic partition visit partition items at the
same time with modifying partitions:
```java
2026-01-12 15:31:46,108 ERROR (thrift-server-pool-31|451) [ProcessFunction.process():47] Internal error processing createPartition
java.lang.reflect.UndeclaredThrowableException
	at jdk.proxy2/jdk.proxy2.$Proxy27.createPartition(Unknown Source)
	at org.apache.doris.thrift.FrontendService$Processor$createPartition.getResult(FrontendService.java:4993)
	at org.apache.doris.thrift.FrontendService$Processor$createPartition.getResult(FrontendService.java:4973)
	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38)
	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:38)
	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:250)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.doris.service.FeServer.lambda$start$0(FeServer.java:60)
	... 9 more
Caused by: java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1597)
	at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1630)
	at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1628)
	at java.base/java.util.AbstractCollection.toArray(AbstractCollection.java:146)
	at java.base/java.util.ArrayList.<init>(ArrayList.java:181)
	at org.apache.doris.clone.DynamicPartitionScheduler.getHistoricalPartitions(DynamicPartitionScheduler.java:209)
	at org.apache.doris.common.util.AutoBucketCalculator.calculateAutoBuckets(AutoBucketCalculator.java:142)
	at org.apache.doris.common.util.AutoBucketCalculator.calculateAutoBucketsWithBoundsCheck(AutoBucketCalculator.java:190)
	at org.apache.doris.analysis.PartitionExprUtil.getAddPartitionClauseFromPartitionValues(PartitionExprUtil.java:202)
	at org.apache.doris.service.FrontendServiceImpl.createPartition(FrontendServiceImpl.java:3622)
	... 13 more
```

all these visit operations should under table's lock.
@github-actions github-actions bot requested a review from yiguolei as a code owner January 14, 2026 13:51
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Jan 14, 2026
@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 88.89% (8/9) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 13b157c into branch-4.0 Jan 15, 2026
25 of 28 checks passed
@github-actions github-actions bot deleted the auto-pick-59848-branch-4.0 branch January 15, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants