lib/storage/table.go: add missing tb.ptwsLock.Unlock() before the return

This is a follow-up for a1083d0531

See https://github.com/VictoriaMetrics/VictoriaMetrics/pull/2103
This commit is contained in:
Aliaksandr Valialkin 2022-01-28 12:12:56 +02:00
parent 1999bbfe82
commit 96aa3761fc
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -362,6 +362,7 @@ func (tb *table) AddRows(rows []rawRow) error {
pt, err := createPartition(r.Timestamp, tb.smallPartitionsPath, tb.bigPartitionsPath, tb.getDeletedMetricIDs, tb.retentionMsecs)
if err != nil {
// Return only the first error, since it has no sense in returning all errors.
tb.ptwsLock.Unlock()
return fmt.Errorf("errors while adding rows to table %q: %w", tb.path, err)
}
pt.AddRows(missingRows[i : i+1])