This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new e7e8d4590eb branch-4.0: [fix](hive) Fix partition values cache sync
issue in Observer FE during insert #59965 (#59994)
e7e8d4590eb is described below
commit e7e8d4590eb0f7124aebd60a1f4163830f194c5a
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Jan 18 14:19:02 2026 +0800
branch-4.0: [fix](hive) Fix partition values cache sync issue in Observer
FE during insert #59965 (#59994)
Cherry-picked from #59965
Co-authored-by: Mingyu Chen (Rayner) <[email protected]>
---
.../doris/datasource/hive/HiveMetaStoreCache.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
index e560099a18d..8b07f3e875a 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
@@ -595,10 +595,21 @@ public class HiveMetaStoreCache {
for (String partitionName : modifiedPartNames) {
invalidatePartitionCache(table, partitionName);
}
-
+ // Merge modifiedPartNames and newPartNames
+ // Case:
+ // 1. hive, insert into a new partition p_new
+ // 2. doris-observer, insert into same partition p_new
+ // 1. forward insert command to Master
+ // 2. Master FE will refresh its cache and get p_new into its
partition values cache
+ // 3. Insert finished and Master write edit log, but p_new is
recorded as MODIFIED not NEW.
+ // (See refreshAffectedPartitions() methods)
+ // 4. Observer FE receive edit log and refresh cache, if we don't
merge them,
+ // it will miss adding p_new to its partition values cache.
+ List<String> mergedPartNames = Lists.newArrayList(modifiedPartNames);
+ mergedPartNames.addAll(newPartNames);
// Add new partitions to partition values cache
- if (!newPartNames.isEmpty()) {
- addPartitionsCache(table.getOrBuildNameMapping(), newPartNames,
+ if (!mergedPartNames.isEmpty()) {
+ addPartitionsCache(table.getOrBuildNameMapping(), mergedPartNames,
table.getPartitionColumnTypes(Optional.empty()));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]