zjw1111 commented on code in PR #264:
URL: https://github.com/apache/paimon-cpp/pull/264#discussion_r3902118562


##########
src/paimon/core/core_options.cpp:
##########
@@ -799,8 +799,14 @@ struct CoreOptions::Impl {
             parser.Parse<bool>(Options::PREFETCH_IO_METRICS_ENABLED, 
&prefetch_io_metrics_enabled));
         // Parse scan.fallback-branch - fallback branch when partition not 
found
         PAIMON_RETURN_NOT_OK(parser.Parse(Options::SCAN_FALLBACK_BRANCH, 
&scan_fallback_branch));
+        if (scan_fallback_branch) {
+            
PAIMON_RETURN_NOT_OK(BranchManager::CheckValidBranch(scan_fallback_branch.value()));
+        }
         // Parse branch - branch name, default "main"
         PAIMON_RETURN_NOT_OK(parser.Parse(Options::BRANCH, &branch));
+        // Both branches name a directory under the table root, so they must 
stay a single path
+        // component.
+        PAIMON_RETURN_NOT_OK(BranchManager::CheckValidBranch(branch));

Review Comment:
   [P2] A whitespace-only branch passes this validation but remains 
unnormalized in `CoreOptions`. `OrphanFilesCleanerImpl` later passes the raw 
value from `GetBranch()` to `RealtimeCommitProperties::OffsetsDirectory()`, 
which resolves it to `branch/branch-   /metadata` instead of the main branch's 
`metadata` directory. Consequently, orphan cleanup for `branch = "   "` skips 
the main branch's real-time offset files even though `CheckValidBranch` treats 
that value as main.



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