Skip to content

Commit 4252aa8

Browse files
committed
Remove --precondition-errors flag
1 parent 06b1ea0 commit 4252aa8

File tree

14 files changed

+26
-90
lines changed

14 files changed

+26
-90
lines changed

cfg/config.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ type FileSystemConfig struct {
541541

542542
MaxReadAheadKb int64 `yaml:"max-read-ahead-kb"`
543543

544-
PreconditionErrors bool `yaml:"precondition-errors"`
545-
546544
RenameDirLimit int64 `yaml:"rename-dir-limit"`
547545

548546
TempDir ResolvedPath `yaml:"temp-dir"`
@@ -1226,12 +1224,6 @@ func BuildFlagSet(flagSet *pflag.FlagSet) error {
12261224

12271225
flagSet.StringP("only-dir", "", "", "Mount only a specific directory within the bucket. See docs/mounting for more information")
12281226

1229-
flagSet.BoolP("precondition-errors", "", true, "Throw Stale NFS file handle error in case the object being synced or read from is modified by some other concurrent process. This helps prevent silent data loss or data corruption.")
1230-
1231-
if err := flagSet.MarkHidden("precondition-errors"); err != nil {
1232-
return err
1233-
}
1234-
12351227
flagSet.StringP("profile", "", "", "The name of the profile to apply. e.g. aiml-training, aiml-serving, aiml-checkpointing")
12361228

12371229
flagSet.IntP("prometheus-port", "", 0, "Expose Prometheus metrics endpoint on this port and a path of /metrics.")
@@ -1829,10 +1821,6 @@ func BindFlags(v *viper.Viper, flagSet *pflag.FlagSet) error {
18291821
return err
18301822
}
18311823

1832-
if err := v.BindPFlag("file-system.precondition-errors", flagSet.Lookup("precondition-errors")); err != nil {
1833-
return err
1834-
}
1835-
18361824
if err := v.BindPFlag("profile", flagSet.Lookup("profile")); err != nil {
18371825
return err
18381826
}

cfg/params.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,6 @@ params:
518518
- bucket-type: "zonal"
519519
value: 16384 # 16 MiB
520520

521-
- config-path: "file-system.precondition-errors"
522-
flag-name: "precondition-errors"
523-
type: "bool"
524-
usage: >-
525-
Throw Stale NFS file handle error in case the object being synced or read
526-
from is modified by some other concurrent process. This helps prevent
527-
silent data loss or data corruption.
528-
hide-flag: true
529-
default: true
530-
531521
- config-path: "file-system.rename-dir-limit"
532522
flag-name: "rename-dir-limit"
533523
type: "int"

cmd/config_validation_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ func TestValidateConfigFile_FileSystemConfigSuccessful(t *testing.T) {
598598
InactiveMrdCacheSize: 1000,
599599
RenameDirLimit: 0,
600600
TempDir: "",
601-
PreconditionErrors: true,
602601
Uid: -1,
603602
MaxReadAheadKb: 0,
604603
},
@@ -619,7 +618,6 @@ func TestValidateConfigFile_FileSystemConfigSuccessful(t *testing.T) {
619618
InactiveMrdCacheSize: 1000,
620619
RenameDirLimit: 0,
621620
TempDir: "",
622-
PreconditionErrors: true,
623621
Uid: -1,
624622
MaxReadAheadKb: 0,
625623
},
@@ -640,7 +638,6 @@ func TestValidateConfigFile_FileSystemConfigSuccessful(t *testing.T) {
640638
InactiveMrdCacheSize: 1000,
641639
RenameDirLimit: 10,
642640
TempDir: cfg.ResolvedPath(path.Join(hd, "temp")),
643-
PreconditionErrors: false,
644641
Uid: 8,
645642
MaxReadAheadKb: 1024,
646643
},

cmd/root_test.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
946946
InactiveMrdCacheSize: 1000,
947947
RenameDirLimit: 0,
948948
TempDir: "",
949-
PreconditionErrors: true,
950949
ExperimentalODirect: false,
951950
Uid: -1,
952951
}
@@ -964,7 +963,7 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
964963
}{
965964
{
966965
name: "normal",
967-
args: []string{"gcsfuse", "--dir-mode=0777", "--disable-parallel-dirops", "--experimental-enable-dentry-cache", "--experimental-enable-readdirplus", "--file-mode=0666", "--o", "ro", "--gid=7", "--ignore-interrupts=false", "--kernel-list-cache-ttl-secs=300", "--rename-dir-limit=10", "--temp-dir=~/temp", "--uid=8", "--precondition-errors=false", "abc", "pqr"},
966+
args: []string{"gcsfuse", "--dir-mode=0777", "--disable-parallel-dirops", "--experimental-enable-dentry-cache", "--experimental-enable-readdirplus", "--file-mode=0666", "--o", "ro", "--gid=7", "--ignore-interrupts=false", "--kernel-list-cache-ttl-secs=300", "--rename-dir-limit=10", "--temp-dir=~/temp", "--uid=8", "abc", "pqr"},
968967
expectedConfig: &cfg.Config{
969968
FileSystem: cfg.FileSystemConfig{
970969
DirMode: 0777,
@@ -979,7 +978,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
979978
InactiveMrdCacheSize: 1000,
980979
RenameDirLimit: 10,
981980
TempDir: cfg.ResolvedPath(path.Join(hd, "temp")),
982-
PreconditionErrors: false,
983981
ExperimentalODirect: false,
984982
Uid: 8,
985983
},
@@ -1002,7 +1000,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
10021000
InactiveMrdCacheSize: 1000,
10031001
RenameDirLimit: 0,
10041002
TempDir: "",
1005-
PreconditionErrors: true,
10061003
ExperimentalODirect: false,
10071004
Uid: -1,
10081005
},
@@ -1025,7 +1022,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
10251022
InactiveMrdCacheSize: 1000,
10261023
RenameDirLimit: 200000,
10271024
TempDir: "",
1028-
PreconditionErrors: true,
10291025
ExperimentalODirect: false,
10301026
Uid: -1,
10311027
},
@@ -1050,7 +1046,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
10501046
InactiveMrdCacheSize: 1000,
10511047
RenameDirLimit: 0,
10521048
TempDir: "",
1053-
PreconditionErrors: true,
10541049
ExperimentalODirect: false,
10551050
Uid: -1,
10561051
},
@@ -1075,7 +1070,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
10751070
InactiveMrdCacheSize: 1000,
10761071
RenameDirLimit: 15000,
10771072
TempDir: "",
1078-
PreconditionErrors: true,
10791073
ExperimentalODirect: false,
10801074
Uid: -1,
10811075
},
@@ -1150,7 +1144,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
11501144
IgnoreInterrupts: true,
11511145
InactiveMrdCacheSize: 1000,
11521146
ExperimentalODirect: true,
1153-
PreconditionErrors: true,
11541147
Uid: -1,
11551148
},
11561149
},
@@ -1167,7 +1160,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
11671160
IgnoreInterrupts: true,
11681161
InactiveMrdCacheSize: 1000,
11691162
ExperimentalODirect: false,
1170-
PreconditionErrors: true,
11711163
Uid: -1,
11721164
MaxReadAheadKb: 1024,
11731165
},
@@ -1184,7 +1176,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
11841176
Gid: -1,
11851177
IgnoreInterrupts: true,
11861178
InactiveMrdCacheSize: 1000,
1187-
PreconditionErrors: true,
11881179
Uid: -1,
11891180
MaxReadAheadKb: 0,
11901181
},
@@ -1202,7 +1193,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12021193
IgnoreInterrupts: true,
12031194
InactiveMrdCacheSize: 1000,
12041195
ExperimentalODirect: false,
1205-
PreconditionErrors: true,
12061196
Uid: -1,
12071197
MaxBackground: 512,
12081198
},
@@ -1220,7 +1210,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12201210
IgnoreInterrupts: true,
12211211
InactiveMrdCacheSize: 1000,
12221212
ExperimentalODirect: false,
1223-
PreconditionErrors: true,
12241213
Uid: -1,
12251214
MaxBackground: 0,
12261215
},
@@ -1238,7 +1227,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12381227
IgnoreInterrupts: true,
12391228
InactiveMrdCacheSize: 1000,
12401229
ExperimentalODirect: false,
1241-
PreconditionErrors: true,
12421230
Uid: -1,
12431231
CongestionThreshold: 256,
12441232
},
@@ -1256,7 +1244,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12561244
IgnoreInterrupts: true,
12571245
InactiveMrdCacheSize: 1000,
12581246
ExperimentalODirect: false,
1259-
PreconditionErrors: true,
12601247
Uid: -1,
12611248
CongestionThreshold: 0,
12621249
},
@@ -1274,7 +1261,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12741261
IgnoreInterrupts: true,
12751262
InactiveMrdCacheSize: 1000,
12761263
ExperimentalODirect: false,
1277-
PreconditionErrors: true,
12781264
Uid: -1,
12791265
EnableKernelReader: true,
12801266
},
@@ -1292,7 +1278,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
12921278
IgnoreInterrupts: true,
12931279
InactiveMrdCacheSize: 1000,
12941280
ExperimentalODirect: false,
1295-
PreconditionErrors: true,
12961281
Uid: -1,
12971282
EnableKernelReader: false,
12981283
},
@@ -1310,7 +1295,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
13101295
IgnoreInterrupts: true,
13111296
InactiveMrdCacheSize: 1000,
13121297
ExperimentalODirect: false,
1313-
PreconditionErrors: true,
13141298
Uid: -1,
13151299
KernelParamsFile: "/tmp/params",
13161300
},
@@ -1328,7 +1312,6 @@ func TestArgsParsing_FileSystemFlags(t *testing.T) {
13281312
IgnoreInterrupts: true,
13291313
InactiveMrdCacheSize: 1000,
13301314
ExperimentalODirect: false,
1331-
PreconditionErrors: true,
13321315
Uid: -1,
13331316
KernelParamsFile: "/tmp/config_params",
13341317
},

cmd/testdata/valid_config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ file-system:
6666
kernel-list-cache-ttl-secs: 300
6767
rename-dir-limit: 10
6868
temp-dir: ~/temp
69-
precondition-errors: false
7069
max-read-ahead-kb: 1024
7170
list:
7271
enable-empty-managed-folders: true

internal/cache/file/downloader/job_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (dt *downloaderTest) getFileInfo() lru.ValueType {
109109

110110
func (dt *downloaderTest) fileCachePath(bucketName string, objectName string) string {
111111
return path.Join(cacheDir, bucketName, objectName)
112+
return path.Join(dt.cacheDir, bucketName, objectName)
112113
}
113114

114115
func (dt *downloaderTest) Test_init() {

internal/fs/fs_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ func (t *fsTest) SetUpTestSuite() {
171171
TtlSecs: 60,
172172
TypeCacheMaxSizeMb: 4,
173173
},
174-
FileSystem: cfg.FileSystemConfig{
175-
PreconditionErrors: false,
176-
},
177174
EnableNewReader: true,
178175
}
179176
}

internal/fs/local_modifications_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,11 +2171,12 @@ func (t *FileTest) Sync_Clobbered() {
21712171
var n int
21722172

21732173
// Create a file.
2174-
t.f1, err = os.Create(path.Join(mntDir, "foo"))
2174+
f, err := os.Create(path.Join(mntDir, "foo"))
21752175
AssertEq(nil, err)
2176+
defer f.Close()
21762177

21772178
// Dirty the file by giving it some contents.
2178-
n, err = t.f1.Write([]byte("taco"))
2179+
n, err = f.Write([]byte("taco"))
21792180
AssertEq(nil, err)
21802181
AssertEq(4, n)
21812182

@@ -2192,9 +2193,9 @@ func (t *FileTest) Sync_Clobbered() {
21922193
// decided to hold back the writes from above until now (in which case the
21932194
// inode will fail to load the source object), or it may fail silently.
21942195
// Either way, this should not result in a new generation being created.
2195-
err = t.f1.Sync()
2196+
err = f.Sync()
21962197
if err != nil {
2197-
ExpectThat(err, Error(HasSubstr("input/output error")))
2198+
ExpectTrue(errors.Is(err, syscall.ESTALE), "err: %v", err)
21982199
}
21992200

22002201
contents, err := storageutil.ReadObject(ctx, bucket, "foo")

internal/fs/notifier_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func (t *NotifierTest) SetupSuite() {
4747
t.serverCfg.NewConfig = &cfg.Config{
4848
FileSystem: cfg.FileSystemConfig{
4949
ExperimentalEnableDentryCache: true,
50-
PreconditionErrors: true,
5150
},
5251
Write: cfg.WriteConfig{
5352
EnableStreamingWrites: true,

internal/fs/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewServer(ctx context.Context, cfg *ServerConfig) (fuse.Server, error) {
3131
return nil, fmt.Errorf("create file system: %w", err)
3232
}
3333

34-
fs = wrappers.WithErrorMapping(fs, cfg.NewConfig.FileSystem.PreconditionErrors)
34+
fs = wrappers.WithErrorMapping(fs)
3535
if newcfg.IsTracingEnabled(cfg.NewConfig) {
3636
fs = wrappers.WithTracing(fs, cfg.TraceHandle)
3737
}

0 commit comments

Comments
 (0)