-
Notifications
You must be signed in to change notification settings - Fork 14
fix(msfs): optimistic-lock copy to remove warm-read serialization #69
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1305,6 +1305,12 @@ func checkConfigFile() (err error) { | |
| err = fmt.Errorf("bad AIStore.timeout at backends[%v (\"%s\")]", backendsAsInterfaceSliceIndex, backendAsStructNew.dirName) | ||
| return | ||
| } | ||
|
|
||
| backendConfigAIStoreAsStruct.manifestGenBackendName, ok = parseString(backendConfigAIStoreAsMap, "manifest_gen_backend", "") | ||
| if !ok { | ||
| err = fmt.Errorf("bad AIStore.manifest_gen_backend at backends[%v (\"%s\")]", backendsAsInterfaceSliceIndex, backendAsStructNew.dirName) | ||
| return | ||
| } | ||
| } else { | ||
| backendConfigAIStoreAsStruct = &backendConfigAIStoreStruct{ | ||
| endpoint: os.Getenv("AIS_ENDPOINT"), | ||
|
|
@@ -1790,6 +1796,36 @@ func checkConfigFile() (err error) { | |
| } | ||
| } | ||
|
|
||
| // Resolve AIStore `manifest_gen_backend` references now that all backends are | ||
| // parsed. Each reference must name another, non-AIStore backend in this config; | ||
| // that backend serves LIST/STAT-DIR while reads continue via AIS. | ||
| for _, aisBackend := range config.backends { | ||
| if aisBackend.backendType != "AIStore" { | ||
| continue | ||
| } | ||
| aisCfg := aisBackend.backendTypeSpecifics.(*backendConfigAIStoreStruct) | ||
| if aisCfg.manifestGenBackendName == "" { | ||
| continue | ||
| } | ||
| if aisCfg.manifestGenBackendName == aisBackend.dirName { | ||
| err = fmt.Errorf("AIStore backend %q manifest_gen_backend cannot reference itself", aisBackend.dirName) | ||
| return | ||
| } | ||
| srcBackend, found := config.backends[aisCfg.manifestGenBackendName] | ||
| if !found { | ||
| err = fmt.Errorf("AIStore backend %q manifest_gen_backend %q not found among configured backends", aisBackend.dirName, aisCfg.manifestGenBackendName) | ||
| return | ||
| } | ||
| if srcBackend.backendType == "AIStore" { | ||
| err = fmt.Errorf("AIStore backend %q manifest_gen_backend %q must not be an AIStore backend", aisBackend.dirName, aisCfg.manifestGenBackendName) | ||
| return | ||
| } | ||
| if srcBackend.bucketContainerName != aisBackend.bucketContainerName || srcBackend.prefix != aisBackend.prefix { | ||
| globals.logger.Printf("[WARN] an AIStore manifest_gen_backend targets a different bucket/prefix than its AIStore backend; listing and reads may not align") | ||
| } | ||
| aisCfg.manifestGenBackend = srcBackend | ||
| } | ||
|
Comment on lines
+1799
to
+1827
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle Line 1799 introduces a new resolved routing field, but the SIGHUP immutability checks for AIStore backends (around Line 2173+) do not compare 🔧 Suggested fixcase "AIStore":
+ if backendAsStructOld.backendTypeSpecifics.(*backendConfigAIStoreStruct).manifestGenBackendName !=
+ backendAsStructNew.backendTypeSpecifics.(*backendConfigAIStoreStruct).manifestGenBackendName {
+ err = fmt.Errorf("cannot change AIStore.manifest_gen_backend in backends[\"%s\"]", dirName)
+ return
+ }
+
if backendAsStructOld.backendTypeSpecifics.(*backendConfigAIStoreStruct).endpoint != backendAsStructNew.backendTypeSpecifics.(*backendConfigAIStoreStruct).endpoint {
err = fmt.Errorf("cannot change AIStore.endpoint in backends[\"%s\"]", dirName)
return
}🤖 Prompt for AI Agents |
||
|
|
||
| if globals.config == nil { | ||
| // Move all (local) config.backends to globals.backendsToMount | ||
|
|
||
|
|
||
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.
Documentation overstates bucket/prefix enforcement.
Line 149 says the referenced backend must match bucket/prefix, but
checkConfigFile()currently only warns on mismatch and still proceeds. Please change wording to “should” (or enforce as an error in code).🤖 Prompt for AI Agents