{"record":{"id":"e6edf28bbea199aa","repo":"weaviate/weaviate","slug":"remove-original-file","errorCode":null,"errorMessage":"remove original file","messagePattern":"remove original file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/hnsw/compact/compactor.go","lineNumber":374,"sourceCode":"\t\treturn false, errors.Wrap(err, \"write sorted file\")\n\t}\n\n\tif err := sfw.Commit(); err != nil {\n\t\treturn false, errors.Wrap(err, \"commit sorted file\")\n\t}\n\n\tc.logger.WithFields(logrus.Fields{\n\t\t\"action\":   \"hnsw_compactor_convert\",\n\t\t\"original\": filepath.Base(f.Path),\n\t\t\"output\":   outFilename,\n\t}).Debug(\"converted file to sorted format\")\n\n\treturn inMemReader.HasReset(), nil\n}\n\nfunc (c *Compactor) removeConvertedSource(f FileInfo) error {\n\tif err := c.fs.Remove(f.Path); err != nil && !os.IsNotExist(err) {\n\t\treturn errors.Wrap(err, \"remove original file\")\n\t}\n\treturn nil\n}\n\n// decideAction determines what compaction action to take based on current state.\nfunc (c *Compactor) decideAction(state *DirectoryState) Action {\n\tsnapshotSize := state.TotalSnapshotSize()\n\tsortedSize := state.TotalSortedSize()\n\ttotalSize := snapshotSize + sortedSize\n\tsortedCount := len(state.SortedFiles)\n\n\tlog := c.logger.WithFields(logrus.Fields{\n\t\t\"action\":        \"hnsw_compactor_decide\",\n\t\t\"snapshot_size\": snapshotSize,\n\t\t\"sorted_size\":   sortedSize,\n\t\t\"sorted_count\":  sortedCount,\n\t\t\"has_snapshot\":  state.Snapshot != nil,\n\t\t\"threshold\":     c.config.SnapshotThreshold,","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/hnsw/compact/compactor.go#L356-L392","documentation":"Deleting the original raw/condensed commit log file after its sorted replacement was committed failed in removeConvertedSource. Only ENOENT is tolerated (someone else already removed it); any other Remove error — permissions or EIO — is surfaced. Because the sorted replacement is durable, a lingering original is merely redundant: overlap resolution deletes it on a later cycle.","triggerScenarios":"Thrown at adapters/repos/db/vector/hnsw/compact/compactor.go:374 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rely on the next cycle's overlap resolution, which deletes the contained redundant file automatically","Fix directory permissions if Remove keeps failing","Delete the stale file manually once Weaviate is not writing to it"],"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"}