-
Notifications
You must be signed in to change notification settings - Fork 468
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
crl-release-22.2: vfs: default to Unix semantics in MemFS #3000
Conversation
Default to Unix semantics in MemFS. The Windows semantics are left as configurable for unit tests that seek to ensure we don't remove open files, when possible. There are existing cases where we cannot satisfy Windows semantics, and Go does not support opening files with the appropriate `FILE_SHARE_DELETE` permission bit (see golang/go#34681, golang/go#32088). The MemFS's implementation of Windows semantics is useful for ensuring we don't regress in the cases where we can satisfy Windows semantics. Close cockroachdb#2064. Informs cockroachdb#1236.
Windows build failed (and has been failing on
|
Investigating a fix to that separately in #3001. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @jbowens and @sumeerbhola)
vfs/mem_fs.go
line 93 at r1 (raw file):
// semantics, in particular with respect to whether any of an open file's links // may be removed. Windows semantics default to off. func (y *MemFS) UseWindowsSemantics(windowsSemantics bool) {
[nit] I don't think we need the argument, we can just make it turn it on always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @RaduBerinde and @sumeerbhola)
vfs/mem_fs.go
line 93 at r1 (raw file):
Previously, RaduBerinde wrote…
[nit] I don't think we need the argument, we can just make it turn it on always.
True — I'm going to leave it to maintain an identical backport commit, but we can definitely change it on master.
Backport of #2065. Informs cockroachdb/cockroach#112087.
Default to Unix semantics in MemFS. The Windows semantics are left as configurable for unit tests that seek to ensure we don't remove open files, when possible.
There are existing cases where we cannot satisfy Windows semantics, and Go does not support opening files with the appropriate
FILE_SHARE_DELETE
permission bit (see golang/go#34681, golang/go#32088). The MemFS's implementation of Windows semantics is useful for ensuring we don't regress in the cases where we can satisfy Windows semantics.Close #2064.
Informs #1236.