{"record":{"id":"5270492ae2ac4440","repo":"weaviate/weaviate","slug":"failed-to-unregister-commitlog-compaction-from-mai","errorCode":null,"errorMessage":"failed to unregister commitlog compaction from maintenance cycle","messagePattern":"failed to unregister commitlog compaction from maintenance cycle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/hnsw/commit_logger.go","lineNumber":431,"sourceCode":"func (l *hnswCommitLogger) Reset() error {\n\tl.Lock()\n\tdefer l.Unlock()\n\n\treturn l.walWriter.WriteResetIndex()\n}\n\n// Shutdown waits for ongoing maintenance processes to stop, then cancels their\n// scheduling. The caller can be sure that state on disk is immutable after\n// calling Shutdown().\nfunc (l *hnswCommitLogger) Shutdown(ctx context.Context) error {\n\tif l.switchLogsCallbackCtrl != nil {\n\t\tif err := l.switchLogsCallbackCtrl.Unregister(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unregister commitlog switch from maintenance cycle\")\n\t\t}\n\t}\n\tif l.maintainLogsCallbackCtrl != nil {\n\t\tif err := l.maintainLogsCallbackCtrl.Unregister(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unregister commitlog compaction from maintenance cycle\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (l *hnswCommitLogger) RootPath() string {\n\treturn l.rootPath\n}\n\n// ActiveFilePath returns the absolute path of the file the writer would\n// append to right now. It is captured under l.Mutex, so it can never\n// disagree with whatever a concurrent AddNode / switch sees.\n//\n// The backup path (hnsw.ListFiles) uses this to exclude the active file by\n// identity. We can't rely on \"the active file is empty after\n// PrepareForBackup\" because PrepareForBackup releases this mutex before\n// returning, and writers (re-armed by the queue's deferred Resume) can\n// land an AddNode + Flush against the new file before ListFiles enumerates","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/hnsw/commit_logger.go#L413-L449","documentation":"Same shutdown path as the switch-callback unregister, but for the commitlog-compaction (maintainLogs) callback. Failure means periodic compaction scheduling could not be cancelled, so Shutdown cannot guarantee the commit log is immutable afterwards and returns an error.","triggerScenarios":"Thrown at adapters/repos/db/vector/hnsw/commit_logger.go:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped Unregister error; retry shutdown with a longer context","Check for stuck maintenance goroutines preventing unregistration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}