User/kylemoore/c2c stage enumerate from root#3393
Open
kylemoore-microsoft wants to merge 12 commits intomover/c2c-stagefrom
Open
User/kylemoore/c2c stage enumerate from root#3393kylemoore-microsoft wants to merge 12 commits intomover/c2c-stagefrom
kylemoore-microsoft wants to merge 12 commits intomover/c2c-stagefrom
Conversation
…ion to always operate with leading '/'
pbanakar-microsoft
approved these changes
Mar 10, 2026
…s causing directories to never be matched
…oore/c2c-stage-enumerateFromRoot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in syncOrchestrator where nameless virtual (ex: ///b.txt) directories in azure blob storage and S3 were resulting in infinite loops.
When a nameless dir reached processor(), buildChildDir() would incorrectly return the same path as the parent. It would get enqueued again and there would be an infinite loop
The fix is to update syncOrchestrator such that st.dir always has a trailing '/', and when a nameless dir is passed to buildChildPath() another trailing slash is appended. For example, imagine there is a nameless dir at the root. buildChildDir("/", "") is called and it returns "//".
An important change was made to syncOrchestrator to support this behavior. I modified the traverser to always construct paths which have a leading slash and a trailing slash in case of directory. This was done because it made it really easy to handle nameless dirs. If you ever encounter a nameless dir, all you have to do is append another slash to the path. For example at root the path is "/", so you just append another slash for "//" if there is a nameless dir. Similarly if the current path is "/dir1/" you just append a slash for "/dir1//".
Type of Change
How Has This Been Tested?
Test Results Summary
Test location: c2ctest/sync_orchestrator_test.go
Command: go test -tags "netgo,smslidingwindow" -timeout=1h -v -run "TestSync_C2C_" ./c2ctest
Build tag: smslidingwindow (exercises the syncOrchestrator code path)
Results: 14/20 tests passed, 6 failed
Each test case is run for BlobBlob S3Blob BlobFSBlobFS BlobFSBlob BlobBlobFS
Failure Categories (all pre-existing, not regressions)
--delete-destination=truepath.Joinnormalizes nameless virtual dir paths (a///b→a/b), causing filesunder single-char dirs to be incorrectly deleted
URLWithPlusDecodedInPathpanics for S3 URLs with CJK characters in subpathAll failures are identical with and without the
smslidingwindowbuild tag, confirming zero regressions from thesyncOrchestrator.