forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not rename files on mmap failure (influxdata#23396)
If NewTSMReader() fails because mmap fails, do not rename the file, because the error is probably caused by vm.max_map_count being too low closes influxdata#23172
- Loading branch information
1 parent
b4899ca
commit 006d18b
Showing
5 changed files
with
202 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package tsm1 | ||
|
||
import ( | ||
"github.com/influxdata/influxdb/tsdb" | ||
) | ||
|
||
var TestMmapInitFailOption = func(err error) tsmReaderOption { | ||
return func(r *TSMReader) { | ||
r.accessor = &badBlockAccessor{error: err} | ||
} | ||
} | ||
|
||
type badBlockAccessor struct { | ||
error | ||
} | ||
|
||
func (b *badBlockAccessor) init() (*indirectIndex, error) { | ||
return nil, b.error | ||
} | ||
|
||
func (b *badBlockAccessor) read(key []byte, timestamp int64) ([]Value, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readAll(key []byte) ([]Value, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readBlock(entry *IndexEntry, values []Value) ([]Value, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readFloatBlock(entry *IndexEntry, values *[]FloatValue) ([]FloatValue, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readFloatArrayBlock(entry *IndexEntry, values *tsdb.FloatArray) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readIntegerBlock(entry *IndexEntry, values *[]IntegerValue) ([]IntegerValue, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readIntegerArrayBlock(entry *IndexEntry, values *tsdb.IntegerArray) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readUnsignedBlock(entry *IndexEntry, values *[]UnsignedValue) ([]UnsignedValue, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readUnsignedArrayBlock(entry *IndexEntry, values *tsdb.UnsignedArray) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readStringBlock(entry *IndexEntry, values *[]StringValue) ([]StringValue, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readStringArrayBlock(entry *IndexEntry, values *tsdb.StringArray) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readBooleanBlock(entry *IndexEntry, values *[]BooleanValue) ([]BooleanValue, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readBooleanArrayBlock(entry *IndexEntry, values *tsdb.BooleanArray) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) readBytes(entry *IndexEntry, buf []byte) (uint32, []byte, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) rename(path string) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) path() string { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) close() error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (b *badBlockAccessor) free() error { | ||
//TODO implement me | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters