danny0405 commented on code in PR #18384:
URL: https://github.com/apache/hudi/pull/18384#discussion_r3256089704


##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -541,6 +553,13 @@ private static void modify(HoodieStorage storage, 
StoragePath metadataFolder, Pr
       // 1. Read the existing config
       TypedProperties props = fetchConfigs(storage, metadataFolder, 
HOODIE_PROPERTIES_FILE, HOODIE_PROPERTIES_FILE_BACKUP, MAX_READ_RETRIES, 
READ_RETRY_DELAY_MSEC);
 
+      // 1a. Validate meta-field-population state transitions BEFORE any 
destructive write,
+      // so a rejected transition leaves hoodie.properties (and the backup) 
untouched.
+      // Also yields any extra keys to delete (currently: 
META_FIELDS_EXCLUDE_LIST when
+      // populate flips true->false) so the persisted state stays internally 
consistent.
+      Set<String> extraDeletes =
+          validateAndNormalizeMetaFieldsTransition(props, modifyProps, 
propsToUpdate, propsToDelete);

Review Comment:
   we better not throw logic exception expliitly here in the `#modify` method 
which better to keep transparant to valition logic,maybe move the validation 
into before the actual `#modify`.



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

Reply via email to