{"record":{"id":"a270cf76347b8dc5","repo":"weaviate/weaviate","slug":"get-file-info","errorCode":null,"errorMessage":"get file info","messagePattern":"get file info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/hnsw/commit_logger.go","lineNumber":513,"sourceCode":"}\n\nfunc (l *hnswCommitLogger) ResumeAfterBackup(ctx context.Context) error {\n\t// Nothing to do here. The backup invariant (\"listed files are immutable\n\t// for the duration of the copy\") is upheld by ListFiles excluding the\n\t// active commit log file by path. The active file *does* receive writes\n\t// during a backup, but it is never part of the file set the backup\n\t// machinery copies.\n\treturn nil\n}\n\nfunc (l *hnswCommitLogger) switchCommitLogs(force bool) (bool, error) {\n\tl.Lock()\n\tdefer l.Unlock()\n\n\t// Get current file size\n\tinfo, err := l.currentFile.Stat()\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"get file info\")\n\t}\n\tsize := info.Size()\n\n\tif size <= l.maxSizeIndividual && !force {\n\t\treturn false, nil\n\t}\n\n\toldFile := l.currentFile\n\toldWriter := l.currentWriter\n\toldFileName := l.currentFileName\n\n\t// Flush and fsync the current file so its bytes are durable before we stop\n\t// appending to it. The old file is deliberately NOT closed yet: every step\n\t// below can fail (ENOSPC/EIO), and l.currentFile must never be left pointing\n\t// at a dead fd. While the old file stays open and assigned, a failure here\n\t// just aborts the rotation and writes continue against it.\n\tif err := oldWriter.Flush(); err != nil {\n\t\treturn true, errors.Wrap(err, \"flush commit log\")","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/hnsw/commit_logger.go#L495-L531","documentation":"switchCommitLogs stats the active commit-log file to decide whether it exceeds the size threshold and must be rotated. This wrapper fires when l.currentFile.Stat fails — file deleted underneath the logger, descriptor error, or I/O failure — so rotation cannot be evaluated and the switch aborts.","triggerScenarios":"Thrown at adapters/repos/db/vector/hnsw/commit_logger.go:513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error: the active commit-log file may have been removed externally","Verify no external cleanup deletes WAL files while the shard is open; retry the switch"],"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"}