Skip to content

Commit 52cd83d

Browse files
fix: correct error logic for writing empty index files (#27123) (#27124)
See discussion in #27086 (cherry picked from commit e5293b7)
1 parent 1a6880b commit 52cd83d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/influx_inspect/deletetsm/deletetsm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (cmd *Command) process(path string) (retErr error) {
144144

145145
// Write index & close.
146146
// It is okay to have no index values if no block was written
147-
if err := w.WriteIndex(); err != nil && !(blockWritten || errors.Is(err, tsm1.ErrNoValues)) {
147+
if err := w.WriteIndex(); err != nil && !(errors.Is(err, tsm1.ErrNoValues) && !blockWritten) {
148148
return 0, err
149149
} else {
150150
return w.Size(), nil

0 commit comments

Comments
 (0)