Skip to content

Commit

Permalink
[BugFix] Fix local file rename in broker (#52544)
Browse files Browse the repository at this point in the history
Signed-off-by: wyb <[email protected]>
  • Loading branch information
wyb authored Nov 1, 2024
1 parent c15d401 commit 6e5e594
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,12 @@ public void deletePath(String path, Map<String, String> properties) {

public void renamePath(String srcPath, String destPath, Map<String, String> properties) {
WildcardURI srcPathUri = new WildcardURI(srcPath);
String srcAuthority = srcPathUri.getAuthority();
WildcardURI destPathUri = new WildcardURI(destPath);
if (!srcPathUri.getAuthority().trim().equals(destPathUri.getAuthority().trim())) {
String destAuthority = destPathUri.getAuthority();
// the authority of local file path is null, like file:///xxx.
// skip check when the authority is null.
if (srcAuthority != null && destAuthority != null && !srcAuthority.trim().equals(destAuthority.trim())) {
throw new BrokerException(TBrokerOperationStatusCode.TARGET_STORAGE_SERVICE_ERROR,
"only allow rename in same file system");
}
Expand Down

0 comments on commit 6e5e594

Please sign in to comment.