Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Tsavorite checkpoint path handling to be OS-aware #306

Merged
merged 10 commits into from
Apr 23, 2024

Conversation

PaulusParssinen
Copy link
Contributor

No description provided.

@PaulusParssinen
Copy link
Contributor Author

PaulusParssinen commented Apr 22, 2024

Something odd happening with the paths used in the cloud tests. Probably related to the Path.Join behavior which preserves seperators.

@PaulusParssinen
Copy link
Contributor Author

PaulusParssinen commented Apr 22, 2024

The problem is the fact that Tsavorite previously assumed all path-seperators to be / and let the windows NT APIs to deal with the canonicalization instead. This PR makes this OS-aware and uses \ for Windows which made the Azure storage tests explode as they use the same naming scheme. I propose to introducing a separate ICheckpointNamingScheme implementation i.e. AzureCheckpointNamingScheme in the AzureStorageDevice for this.. I'll test how that'd work out. I think it's general goodness to switch to System.IO.Path APIs.

This AzureCheckpointNamingScheme should be used when a DeviceLogCommitCheckpointManager is created with backing AzureStorageNamedDeviceFactory.

* Add AzureCheckpointNamingScheme which uses / as the checkpoint path seperator
@PaulusParssinen
Copy link
Contributor Author

PaulusParssinen commented Apr 22, 2024

Making rest of the Tsavorite tests use System.IO.Path APIs for consistency with mass-regex and some manual skimming through.

@PaulusParssinen PaulusParssinen marked this pull request as draft April 22, 2024 19:24
@PaulusParssinen
Copy link
Contributor Author

Actually, I'll have that in separate PR.

@PaulusParssinen PaulusParssinen marked this pull request as ready for review April 22, 2024 20:15
@PaulusParssinen PaulusParssinen changed the title Refactor Tsavorite file path construction Refactor Tsavorite file path construction to be OS-aware Apr 22, 2024
@PaulusParssinen PaulusParssinen changed the title Refactor Tsavorite file path construction to be OS-aware Refactor Tsavorite checkpoint path handling to be OS-aware Apr 22, 2024
Revert "Experiment using Path.Join in Tsavorite.tests"

This reverts commit d8424d4.

Revert "Use OS directory seperator char to split the basePath in Azure storage device"

This reverts commit b5fd3d8.

Revert "Or normalize the path to /"

This reverts commit c7f399b.
Copy link
Contributor

@TedHartMS TedHartMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@TalZaccai TalZaccai merged commit 745db47 into microsoft:main Apr 23, 2024
28 checks passed
@PaulusParssinen PaulusParssinen deleted the tsavorite-io-paths branch April 23, 2024 21:06
@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants