{"record":{"id":"89be6bcccec5a541","repo":"thanos-io/thanos","slug":"commit-samples-89be6b","errorCode":null,"errorMessage":"commit samples","messagePattern":"commit samples","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/receive/writer.go","lineNumber":168,"sourceCode":"\t\t\t\tlabelpb.ReAllocZLabelsStrings(&ex.Labels)\n\t\t\t\texLset := labelpb.ZLabelsToPromLabels(ex.Labels)\n\t\t\t\texLogger := log.With(tLogger, \"exemplarLset\", exLset, \"exemplar\", ex.String())\n\n\t\t\t\tif _, err = app.AppendExemplar(ref, lset, exemplar.Exemplar{\n\t\t\t\t\tLabels: exLset,\n\t\t\t\t\tValue:  ex.Value,\n\t\t\t\t\tTs:     ex.Timestamp,\n\t\t\t\t\tHasTs:  true,\n\t\t\t\t}); err != nil {\n\t\t\t\t\terrorTracker.addExemplarError(err, exLogger)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\terrs := errorTracker.collectErrors(tLogger)\n\tif err := app.Commit(); err != nil {\n\t\terrs.Add(errors.Wrap(err, \"commit samples\"))\n\t}\n\treturn errs.ErrOrNil()\n}\n","sourceCodeStart":150,"sourceCodeEnd":172,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/receive/writer.go#L150-L172","documentation":"Error added by Writer.Write when app.Commit() fails after appending all samples/histograms/exemplars. Commit persists the appended data into the TSDB head; failure means none of this batch is durable and the whole write should be considered failed. The raw storage error is wrapped as 'commit samples'.","triggerScenarios":"app.Commit() returning an error at the end of Write - typically because the TSDB head is closing/closed, a rollback happened internally, or the underlying WAL write failed.","commonSituations":"Receiver shutting down while writes are in flight; WAL directory full or on failing disk; TSDB head corruption; context-cancellation paths in the appender.","solutions":["Check the wrapped cause and receiver logs for TSDB/WAL errors (disk full, corruption).","Free disk space / fix WAL directory permissions on the receive volume.","Have the sender retry the remote-write request - the failed commit did not persist data, so retry is safe.","Restart the receiver if the head is in an unrecoverable state and restore from block storage."],"exampleFix":"// sender-side retry on commit failure\nfor attempt := 0; attempt < 3; attempt++ {\n    if err := writer.Write(ctx, tenant, batch); err == nil { break }\n    time.Sleep(backoff(attempt))\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := writer.Write(ctx, tenant, series); err != nil {\n    if strings.Contains(err.Error(), \"commit samples\") {\n        // safe to retry: commit failed so nothing was persisted\n        return retryWithBackoff(ctx, tenant, series)\n    }\n}","preventionTips":["Guarantee free disk space for the TSDB WAL","Gracefully drain receivers before shutdown","Alert on WAL write errors and disk usage","Retry idempotently on the sender side"],"tags":["thanos","receive","tsdb","commit","wal","go"],"backgroundTag":"database-write-failed","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}