diff --git a/lib/config/config.go b/lib/config/config.go index 08feb4aa1..45eff1600 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -31,7 +31,7 @@ import ( const ( OldestHandledVersion = 10 - CurrentVersion = 50 + CurrentVersion = 51 MaxRescanIntervalS = 365 * 24 * 60 * 60 ) diff --git a/lib/config/config_test.go b/lib/config/config_test.go index 1ae4404fa..71c0b5238 100644 --- a/lib/config/config_test.go +++ b/lib/config/config_test.go @@ -120,7 +120,7 @@ func TestDefaultValues(t *testing.T) { }, MaxConflicts: 10, MarkerName: ".stfolder", - MaxConcurrentWrites: 2, + MaxConcurrentWrites: maxConcurrentWritesDefault, XattrFilter: XattrFilter{ Entries: []XattrFilterEntry{}, MaxSingleEntrySize: 1024, diff --git a/lib/config/folderconfiguration.go b/lib/config/folderconfiguration.go index 1dee2085e..a6abedab5 100644 --- a/lib/config/folderconfiguration.go +++ b/lib/config/folderconfiguration.go @@ -36,8 +36,8 @@ var ( const ( DefaultMarkerName = ".stfolder" EncryptionTokenName = "syncthing-encryption_password_token" //nolint: gosec - maxConcurrentWritesDefault = 2 - maxConcurrentWritesLimit = 64 + maxConcurrentWritesDefault = 16 + maxConcurrentWritesLimit = 256 ) type FolderDeviceConfiguration struct { @@ -76,7 +76,7 @@ type FolderConfiguration struct { MarkerName string `json:"markerName" xml:"markerName"` CopyOwnershipFromParent bool `json:"copyOwnershipFromParent" xml:"copyOwnershipFromParent"` RawModTimeWindowS int `json:"modTimeWindowS" xml:"modTimeWindowS"` - MaxConcurrentWrites int `json:"maxConcurrentWrites" xml:"maxConcurrentWrites" default:"2"` + MaxConcurrentWrites int `json:"maxConcurrentWrites" xml:"maxConcurrentWrites" default:"0"` DisableFsync bool `json:"disableFsync" xml:"disableFsync"` BlockPullOrder BlockPullOrder `json:"blockPullOrder" xml:"blockPullOrder"` CopyRangeMethod CopyRangeMethod `json:"copyRangeMethod" xml:"copyRangeMethod" default:"standard"` diff --git a/lib/config/migrations.go b/lib/config/migrations.go index 532b3012c..99dadb6ed 100644 --- a/lib/config/migrations.go +++ b/lib/config/migrations.go @@ -28,6 +28,7 @@ import ( // put the newest on top for readability. var ( migrations = migrationSet{ + {51, migrateToConfigV51}, {50, migrateToConfigV50}, {37, migrateToConfigV37}, {36, migrateToConfigV36}, @@ -98,6 +99,18 @@ func (m migration) apply(cfg *Configuration) { cfg.Version = m.targetVersion } +func migrateToConfigV51(cfg *Configuration) { + oldDefault := 2 + for i, fcfg := range cfg.Folders { + if fcfg.MaxConcurrentWrites == oldDefault { + cfg.Folders[i].MaxConcurrentWrites = maxConcurrentWritesDefault + } + } + if cfg.Defaults.Folder.MaxConcurrentWrites == oldDefault { + cfg.Defaults.Folder.MaxConcurrentWrites = maxConcurrentWritesDefault + } +} + func migrateToConfigV50(cfg *Configuration) { // v50 is Syncthing 2.0 }