Repository navigation
Rename Windows staging files through NtSetInformationFile - #3
Open
solakpetri wants to merge 2 commits into
Open
solakpetri wants to merge 2 commits into
solakpetri wants to merge 2 commits into
Conversation
SetFileInformationByHandle(FileRenameInfo) refuses a non-null RootDirectory with ERROR_INVALID_PARAMETER, so every parent-relative publication and journal sidecar rename failed on Windows: database creation, write copies and journaled edits reported an uncertain outcome and left the staging file behind. The native FileRenameInformation class accepts the retained parent handle and still refuses replacement with STATUS_OBJECT_NAME_COLLISION.
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.
What changed
windows_fs::rename_no_replacenow callsNtSetInformationFile(FileRenameInformation)instead ofSetFileInformationByHandle(FileRenameInfo). The buffer layout, retained parent handle, bounded name and disabled replacement are unchanged.docs/foundation/IO.mdanddocs/development/DEPENDENCIES.mdnow name the native rename class.Why
SetFileInformationByHandle(FileRenameInfo)refuses a non-nullRootDirectorywithERROR_INVALID_PARAMETER. Every rename relative to the retained parent therefore failed on Windows:tablecraft create x.accdb --blankreportedpublication visibility is uncertain: I/O failed (InvalidInput)and left a.tablecraft-stage-*file in the target folder.journal/filesystem_windows/setup.rs,pair.rs) hit the same call, so journaled edits could not complete either.tablecraft-iofailed with the same error (the publication rename test and fourwindows_pair_*journal tests).The native rename class accepts the parent handle with a relative name. It still refuses an existing target with
STATUS_OBJECT_NAME_COLLISION, which maps toAlreadyExists, so callers' collision handling is unchanged.I confirmed the cause with a standalone program on the same machine:
RootDirectorySetFileInformationByHandle(FileRenameInfo)ERROR_INVALID_PARAMETER(87)SetFileInformationByHandle(FileRenameInfo)NtSetInformationFile(FileRenameInformation)NtSetInformationFile(FileRenameInformation)STATUS_OBJECT_NAME_COLLISIONHow it was verified
Windows 11 Home 10.0.26300 x64, local NTFS, Rust 1.99.0 (
x86_64-pc-windows-msvc):cargo test --release -p tablecraft-io --all-features --lib --bins --tests: 110 lib tests pass, including the 5 that failed before the change.cargo clippy --release -p tablecraft-io --all-targets --all-features -- -D warnings: clean.scripts/check_rust_layout.pyandscripts/check_documentation_links.py: pass.create --blanksucceeds on two NTFS volumes.createto the same path is refused withAlreadyExistsand leaves no staging file.create --table Items --column Idfollowed byquery journal-insert ... VALUES (42)commits, retires the journal by rename, and reads back the row.Not run
This does not claim Windows runtime qualification beyond these checks.
scripts/check_rust_format.pystill reportscrates/engines/tablecraft-ace/src/queries/creation/tests.rshere. That mismatch is already onmainand is fixed separately in #2; CI on this branch will stop at the format step until that lands.