HIVE-29736: MSCK REPAIR TABLE throws "partition already exists" exception when Metastore URI contains an explicit port and HDFS uses HA Nameservice#6608
Conversation
|
I'm guessing the spark written partition are also contributing to this issue. Sample repro on cluster without HA service enabled: NOTE, ensure |
92dbcae to
0893f73
Compare
|
@deniskuzZ , @dengzhhu653 can you please review this. This is very impactful bug, causing msck repair fail in prod. |
2954f14 to
c9de8f5
Compare
…tastore URI contains an explicit port and HDFS uses HA Nameservice
c9de8f5 to
dd579de
Compare
|
UT failure seems un-related, passing in local, Re-triggering CI |
|



What changes were proposed in this pull request?
This is a behaviour change b/w Hive3 vs Hive4 done in HIVE-23347
It fixes an edge case in
HiveMetaStoreCheckerwhereMSCK REPAIR TABLEcrashes with aMetastoreExceptionwhen comparing partitions on an HDFS HA cluster. When a partition's Metastore URI contains an explicit port (e.g., :8020 ) but the physical Hadoop FileSystem returns paths normalized to the HA nameservice.The PR updates the validation loop to ignore these leftover physical directories if they perfectly map to a partition that was already successfully matched against the Metastore database.
For example:
the
checkTablewill detemine the diff of HDFS vs HMS lookup and it compares complete Path URI and picks the already existing / register partition as a candidate for msck operation. Causing the following stacktrace:Why are the changes needed?
To ensure msck passes.
Does this PR introduce any user-facing change?
NO
How was this patch tested?
On Cluster and wrote a resonating issue Junit