Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The TSM storage engine #4308

Merged
merged 142 commits into from
Oct 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
3446c60
WIP: skeleton for encoding for new engine
pauldix Sep 2, 2015
8d16c96
Add comment about encoding float
pauldix Sep 2, 2015
041e7be
WIP: engine work
pauldix Sep 6, 2015
4e2dfd7
WIP: finish basics of PD1. IT WORKS! (kind of)
pauldix Sep 7, 2015
f37df11
WIP: more WAL work
pauldix Sep 9, 2015
318bc72
Add full durability to WAL and flush on startup
pauldix Sep 17, 2015
95f9e16
Update encoding test to work with new interface.
pauldix Sep 17, 2015
7508568
Add memory settings and WAL backpressure
pauldix Sep 17, 2015
38f9b29
Update engine to put index at the end of data files
pauldix Sep 17, 2015
1b57b80
Add test for close and restart of engine and fix errors.
pauldix Sep 18, 2015
ea85f80
Update wal to only open new segment file on flush if its not an idle …
pauldix Sep 18, 2015
ed70551
Update to work with new cursor definitiono and Point in models
pauldix Sep 25, 2015
0aa6847
Make writes to historical areas possible
pauldix Sep 25, 2015
33d28e1
Ensure we don't have duplicate values. Fix panic in compaction.
pauldix Sep 26, 2015
3aba709
Add multicursor to combine wal and index
pauldix Sep 26, 2015
4db2e5c
Add compaction and time range based write locks.
pauldix Sep 27, 2015
a103432
Handle hash collisions on keys
pauldix Sep 27, 2015
17ed693
Add support for multiple fields
pauldix Sep 27, 2015
f1ba618
Fix wal flushing, compacting, and write lock
pauldix Sep 29, 2015
8444e05
Add PerformMaintenance to store for flushes and compactions.
pauldix Sep 29, 2015
68d03e8
Make compaction run at most at set duration.
pauldix Sep 29, 2015
9e630f8
Ensure data files can't be deleted while query is running.
pauldix Sep 29, 2015
eb24c0d
Add recover to maintenance. Change snapshot writer to not use bolt on…
pauldix Sep 29, 2015
9031804
Update tests to use transactions. Add test for single series 10k points.
pauldix Sep 29, 2015
ca2a13c
Update stress to use second timestamps and less random floats.
pauldix Sep 29, 2015
4fcc61c
Ensure we have files when iterating in cursor
jwilder Sep 21, 2015
938bae9
Fix go vet errors
jwilder Sep 21, 2015
57b0a27
Allow influx_stress to use small data sizes
jwilder Sep 21, 2015
19877a6
Add time and float compression
jwilder Sep 21, 2015
bf74c7c
Add int64 compression
jwilder Sep 24, 2015
fce01a2
Use zigzag encoding for timestamp deltas
jwilder Sep 24, 2015
8ce3d75
Reduce memory allocations
jwilder Sep 25, 2015
071739b
Fix run length encoding check
jwilder Sep 25, 2015
5a49e1a
Add test assertions for time encoding type
jwilder Sep 25, 2015
8d2ecb5
Remove unnecessary allocations from int64 decoder
jwilder Sep 25, 2015
7fe9673
Keep track of the type of the block encoded
jwilder Sep 28, 2015
6c0f53d
Add a compressed boolean encoding
jwilder Sep 28, 2015
3cbd4b1
Update simple8b api usage
jwilder Sep 29, 2015
3ea1b5e
Fix deadlock in pd1_test.go
jwilder Sep 29, 2015
2492218
Add documentation about compression
jwilder Sep 29, 2015
c0eba04
Rename float encoding tests
jwilder Sep 29, 2015
72fa3dd
Update WAL to deduplicate values on Cursor query.
pauldix Sep 29, 2015
6c2bef6
Add logging to pd1
pauldix Sep 30, 2015
4937ae8
Fix panic when data file has small index
pauldix Sep 30, 2015
f29c4c8
Add compressed string encoding
jwilder Sep 29, 2015
c27de6f
Add test with duplicate timestamps
jwilder Sep 30, 2015
9b84a20
Fix bugs with writing old data and compaction.
pauldix Sep 30, 2015
c1accf7
Handle partial reads when loading WAL
jwilder Sep 30, 2015
01b5b92
Fix compaction and multi-write bugs.
pauldix Sep 30, 2015
b826f8d
Remove zig zag encoding from timestamp encoder
jwilder Sep 30, 2015
5326ac4
Fix go vet
jwilder Sep 30, 2015
c0aa5f0
Implement reverse cursor direction on pd1
pauldix Oct 1, 2015
8fa187c
Add deletes to new storage engine
pauldix Oct 1, 2015
5fe3c4e
Rename storage engine to tsm1, for Time Structured Merge Tree!
pauldix Oct 1, 2015
316f74c
Cleanup after pd1 -> tsm1 name change.
pauldix Oct 1, 2015
c8d8ebc
Fix TestStoreOpenShardCreateDelete
jwilder Oct 1, 2015
5800bde
Disable copier test
jwilder Oct 2, 2015
1a174de
Fix go vet errors
jwilder Oct 2, 2015
c2e8922
Move compression encoding constants to encoders
jwilder Oct 2, 2015
33ac598
Propogate all encoding errors to engine
jwilder Oct 2, 2015
6f299aa
Add db crash recovery
pauldix Oct 2, 2015
4d1ce61
do not include empty tags in hash
parisholley Oct 4, 2015
851a53f
Merge pull request #4320 from parisholley/newengineEmpty
pauldix Oct 4, 2015
6504df6
Fix comment typos
jwilder Oct 5, 2015
1448db0
Make DecodeBlock panic if block size is too small
jwilder Oct 5, 2015
e9285f3
Avoid duplicating values slice when encoding
jwilder Oct 5, 2015
a0841c4
Updates based on @otoolp's PR comments
pauldix Oct 4, 2015
ae36c57
Fix deletes not kept if shutdown before flush on tsm1
pauldix Oct 5, 2015
a542d55
Merge pull request #4333 from influxdb/retry_mon_create
otoolep Oct 5, 2015
e3b30e3
Updates based on PR feedback
pauldix Oct 5, 2015
fb2a1cb
WIP: skeleton for encoding for new engine
pauldix Sep 2, 2015
12ea1cb
Add comment about encoding float
pauldix Sep 2, 2015
7555ccb
WIP: engine work
pauldix Sep 6, 2015
2ba032b
WIP: finish basics of PD1. IT WORKS! (kind of)
pauldix Sep 7, 2015
82e1be7
WIP: more WAL work
pauldix Sep 9, 2015
2100e66
Add full durability to WAL and flush on startup
pauldix Sep 17, 2015
5e59cb9
Update encoding test to work with new interface.
pauldix Sep 17, 2015
fe1f9a5
Add memory settings and WAL backpressure
pauldix Sep 17, 2015
c5f6c57
Update engine to put index at the end of data files
pauldix Sep 17, 2015
7c8ab4f
Add test for close and restart of engine and fix errors.
pauldix Sep 18, 2015
365a631
Update wal to only open new segment file on flush if its not an idle …
pauldix Sep 18, 2015
982c28b
Update to work with new cursor definitiono and Point in models
pauldix Sep 25, 2015
0770ccc
Make writes to historical areas possible
pauldix Sep 25, 2015
7baba84
Ensure we don't have duplicate values. Fix panic in compaction.
pauldix Sep 26, 2015
2eb2a64
Add multicursor to combine wal and index
pauldix Sep 26, 2015
48069e7
Add compaction and time range based write locks.
pauldix Sep 27, 2015
667b3e6
Handle hash collisions on keys
pauldix Sep 27, 2015
6c94e73
Add support for multiple fields
pauldix Sep 27, 2015
d694454
Fix wal flushing, compacting, and write lock
pauldix Sep 29, 2015
1c8eac1
Add PerformMaintenance to store for flushes and compactions.
pauldix Sep 29, 2015
b1bdb4f
Make compaction run at most at set duration.
pauldix Sep 29, 2015
0fd116d
Ensure data files can't be deleted while query is running.
pauldix Sep 29, 2015
0b33a71
Add recover to maintenance. Change snapshot writer to not use bolt on…
pauldix Sep 29, 2015
db4ad33
Update tests to use transactions. Add test for single series 10k points.
pauldix Sep 29, 2015
12e14f1
Update stress to use second timestamps and less random floats.
pauldix Sep 29, 2015
88248f3
Ensure we have files when iterating in cursor
jwilder Sep 21, 2015
112a03f
Fix go vet errors
jwilder Sep 21, 2015
42e1bab
Add time and float compression
jwilder Sep 21, 2015
4a37ba8
Add int64 compression
jwilder Sep 24, 2015
ce1d45e
Use zigzag encoding for timestamp deltas
jwilder Sep 24, 2015
092689c
Reduce memory allocations
jwilder Sep 25, 2015
e42d866
Fix run length encoding check
jwilder Sep 25, 2015
95046c1
Add test assertions for time encoding type
jwilder Sep 25, 2015
731ae27
Remove unnecessary allocations from int64 decoder
jwilder Sep 25, 2015
1196587
Keep track of the type of the block encoded
jwilder Sep 28, 2015
cb23f5a
Add a compressed boolean encoding
jwilder Sep 28, 2015
7e0df18
Update simple8b api usage
jwilder Sep 29, 2015
2da52ec
Fix deadlock in pd1_test.go
jwilder Sep 29, 2015
a4d9216
Add documentation about compression
jwilder Sep 29, 2015
9f9692a
Rename float encoding tests
jwilder Sep 29, 2015
c1213ba
Update WAL to deduplicate values on Cursor query.
pauldix Sep 29, 2015
be011b8
Add logging to pd1
pauldix Sep 30, 2015
861a15b
Fix panic when data file has small index
pauldix Sep 30, 2015
c47d145
Add compressed string encoding
jwilder Sep 29, 2015
5d938d0
Add test with duplicate timestamps
jwilder Sep 30, 2015
3332236
Fix bugs with writing old data and compaction.
pauldix Sep 30, 2015
2366baa
Handle partial reads when loading WAL
jwilder Sep 30, 2015
a2b139e
Fix compaction and multi-write bugs.
pauldix Sep 30, 2015
d9499f0
Remove zig zag encoding from timestamp encoder
jwilder Sep 30, 2015
dbf6228
Fix go vet
jwilder Sep 30, 2015
4beca1a
Implement reverse cursor direction on pd1
pauldix Oct 1, 2015
0a11a2f
Add deletes to new storage engine
pauldix Oct 1, 2015
594253c
Rename storage engine to tsm1, for Time Structured Merge Tree!
pauldix Oct 1, 2015
d47ddb5
Cleanup after pd1 -> tsm1 name change.
pauldix Oct 1, 2015
ab791ba
Fix TestStoreOpenShardCreateDelete
jwilder Oct 1, 2015
5d9b89d
Disable copier test
jwilder Oct 2, 2015
b1a57e1
Fix go vet errors
jwilder Oct 2, 2015
4c54c78
Move compression encoding constants to encoders
jwilder Oct 2, 2015
1d754db
Propogate all encoding errors to engine
jwilder Oct 2, 2015
d9f94bd
Add db crash recovery
pauldix Oct 2, 2015
36898f9
do not include empty tags in hash
parisholley Oct 4, 2015
b044970
Fix comment typos
jwilder Oct 5, 2015
cb28dab
Make DecodeBlock panic if block size is too small
jwilder Oct 5, 2015
c6f2f9c
Avoid duplicating values slice when encoding
jwilder Oct 5, 2015
bb398da
Updates based on @otoolp's PR comments
pauldix Oct 4, 2015
26a93ec
Fix deletes not kept if shutdown before flush on tsm1
pauldix Oct 5, 2015
267f34b
Updates based on PR feedback
pauldix Oct 5, 2015
27d0db3
Merge branch 'pd-storage-engine' of github.com:influxdb/influxdb into…
pauldix Oct 6, 2015
be477b2
Fix cursor bug on index
pauldix Oct 6, 2015
41e3294
Fix panic: assignment to entry in nil map
jwilder Oct 6, 2015
40ff4f4
Change default to bz1
pauldix Oct 6, 2015
b113081
Only limit field count for non-tsm engines
pauldix Oct 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion etc/config.sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ reporting-disabled = false
[data]
dir = "/var/opt/influxdb/data"

# Controls the engine type for new shards.
# Controls the engine type for new shards. Options are b1, bz1, or tsm1.
# b1 is the 0.9.2 storage engine, bz1 is the 0.9.3 and 0.9.4 engine.
# tsm1 is the 0.9.5 engine
# engine ="bz1"

# The following WAL settings are for the b1 storage engine used in 0.9.2. They won't
Expand Down
9 changes: 8 additions & 1 deletion models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,10 @@ func (p *point) Tags() Tags {
i, key = scanTo(p.key, i, '=')
i, value = scanTagValue(p.key, i+1)

if len(value) == 0 {
continue
}

tags[string(unescapeTag(key))] = string(unescapeTag(value))

i += 1
Expand Down Expand Up @@ -1141,7 +1145,10 @@ func (t Tags) HashKey() []byte {
for k, v := range t {
ek := escapeTag([]byte(k))
ev := escapeTag([]byte(v))
escaped[string(ek)] = string(ev)

if len(ev) > 0 {
escaped[string(ek)] = string(ev)
}
}

// Extract keys and determine final size.
Expand Down
12 changes: 12 additions & 0 deletions models/points_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,18 @@ func TestParsePointUnescape(t *testing.T) {
},
time.Unix(0, 0)))

// tag with no value
test(t, `cpu,regions=east value="1"`,
models.NewPoint("cpu",
models.Tags{
"regions": "east",
"foobar": "",
},
models.Fields{
"value": "1",
},
time.Unix(0, 0)))

// commas in field values
test(t, `cpu,regions=east value="1,0"`,
models.NewPoint("cpu",
Expand Down
1 change: 1 addition & 0 deletions services/copier/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

// Ensure the service can return shard data.
func TestService_handleConn(t *testing.T) {
t.Skip("not implemented for tsm1 engine")
s := MustOpenService()
defer s.Close()

Expand Down
50 changes: 43 additions & 7 deletions tsdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ const (
// we'll need to create backpressure, otherwise we'll fill up the memory and die.
// This number multiplied by the parition count is roughly the max possible memory
// size for the in-memory WAL cache.
DefaultPartitionSizeThreshold = 20 * 1024 * 1024 // 20MB
DefaultPartitionSizeThreshold = 50 * 1024 * 1024 // 50MB

// Default WAL settings for the TSM1 WAL
DefaultFlushMemorySizeThreshold = 5 * 1024 * 1024 // 5MB
DefaultMaxMemorySizeThreshold = 100 * 1024 * 1024 // 100MB
DefaultIndexCompactionAge = time.Minute
DefaultIndexMinCompactionInterval = time.Minute
DefaultIndexMinCompactionFileCount = 5
DefaultIndexCompactionFullAge = 5 * time.Minute
)

type Config struct {
Expand All @@ -63,6 +71,28 @@ type Config struct {
WALFlushColdInterval toml.Duration `toml:"wal-flush-cold-interval"`
WALPartitionSizeThreshold uint64 `toml:"wal-partition-size-threshold"`

// WAL configuration options for tsm1 introduced in 0.9.5
WALFlushMemorySizeThreshold int `toml:"wal-flush-memory-size-threshold"`
WALMaxMemorySizeThreshold int `toml:"wal-max-memory-size-threshold"`

// compaction options for tsm1 introduced in 0.9.5

// IndexCompactionAge specifies the duration after the data file creation time
// at which it is eligible to be compacted
IndexCompactionAge time.Duration `toml:"index-compaction-age"`

// IndexMinimumCompactionInterval specifies the minimum amount of time that must
// pass after a compaction before another compaction is run
IndexMinCompactionInterval time.Duration `toml:"index-min-compaction-interval"`

// IndexCompactionFileCount specifies the minimum number of data files that
// must be eligible for compaction before actually running one
IndexMinCompactionFileCount int `toml:"index-compaction-min-file-count"`

// IndexCompactionFullAge specifies how long after the last write was received
// in the WAL that a full compaction should be performed.
IndexCompactionFullAge time.Duration `toml:"index-compaction-full-age"`

// Query logging
QueryLogEnabled bool `toml:"query-log-enabled"`
}
Expand All @@ -74,12 +104,18 @@ func NewConfig() Config {
WALFlushInterval: toml.Duration(DefaultWALFlushInterval),
WALPartitionFlushDelay: toml.Duration(DefaultWALPartitionFlushDelay),

WALLoggingEnabled: true,
WALReadySeriesSize: DefaultReadySeriesSize,
WALCompactionThreshold: DefaultCompactionThreshold,
WALMaxSeriesSize: DefaultMaxSeriesSize,
WALFlushColdInterval: toml.Duration(DefaultFlushColdInterval),
WALPartitionSizeThreshold: DefaultPartitionSizeThreshold,
WALLoggingEnabled: true,
WALReadySeriesSize: DefaultReadySeriesSize,
WALCompactionThreshold: DefaultCompactionThreshold,
WALMaxSeriesSize: DefaultMaxSeriesSize,
WALFlushColdInterval: toml.Duration(DefaultFlushColdInterval),
WALPartitionSizeThreshold: DefaultPartitionSizeThreshold,
WALFlushMemorySizeThreshold: DefaultFlushMemorySizeThreshold,
WALMaxMemorySizeThreshold: DefaultMaxMemorySizeThreshold,
IndexCompactionAge: DefaultIndexCompactionAge,
IndexMinCompactionFileCount: DefaultIndexMinCompactionFileCount,
IndexCompactionFullAge: DefaultIndexCompactionFullAge,
IndexMinCompactionInterval: DefaultIndexMinCompactionInterval,

QueryLogEnabled: true,
}
Expand Down
33 changes: 31 additions & 2 deletions tsdb/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,31 @@ type Engine interface {
Close() error

SetLogOutput(io.Writer)
LoadMetadataIndex(index *DatabaseIndex, measurementFields map[string]*MeasurementFields) error
LoadMetadataIndex(shard *Shard, index *DatabaseIndex, measurementFields map[string]*MeasurementFields) error

Begin(writable bool) (Tx, error)
WritePoints(points []models.Point, measurementFieldsToSave map[string]*MeasurementFields, seriesToCreate []*SeriesCreate) error
DeleteSeries(keys []string) error
DeleteMeasurement(name string, seriesKeys []string) error
SeriesCount() (n int, err error)

// PerformMaintenance will get called periodically by the store
PerformMaintenance()

// Format will return the format for the engine
Format() EngineFormat

io.WriterTo
}

type EngineFormat int

const (
B1Format EngineFormat = iota
BZ1Format
TSM1Format
)

// NewEngineFunc creates a new engine.
type NewEngineFunc func(path string, walPath string, options EngineOptions) Engine

Expand All @@ -57,9 +71,24 @@ func NewEngine(path string, walPath string, options EngineOptions) (Engine, erro
return newEngineFuncs[options.EngineVersion](path, walPath, options), nil
}

// Only bolt-based backends are currently supported so open it and check the format.
// Only bolt and tsm1 based storage engines are currently supported
var format string
if err := func() error {
// if it's a dir then it's a tsm1 engine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other way to check that it's a tsm1 engine? What happens if we ever add another engine (tsm2?) and it also creates a directory at this point? How will we distinguish in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we have another one we can check the files in the directory. They have a magic number at the beginning for tsm1. This works for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough @pauldix -- long as we're not blocked from adding another.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well -- 1 thing to note. If someone runs with tsm1, upgrades to a future release with support for, say, tsm2, and then downgrades, how will the system responds? Checking the magic number here in tsm1 will allow graceful exit. Not checking it and assuming its tsm1 may result in hard-to-understand crashes on initialization.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, if one upgraded and created a new engine that also used directories in this manner, and then downgraded, this code will not be happy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what would happen if this code did open a later engine without checking for the magic string? And then writes data into it? Best case it might error and do nothing. Worse case it might corrupt the engine it's writing into. A newer engine may be different in only subtle ways, not different enough to cause errors, but perhaps different enough to corrupt existing data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll update it to check if there are tsm files and check the magic number of the first one. Will do that later this week, but I've made a note of it.

f, err := os.Open(path)
if err != nil {
return err
}
fi, err := f.Stat()
f.Close()
if err != nil {
return err
}
if fi.Mode().IsDir() {
format = "tsm1"
return nil
}

db, err := bolt.Open(path, 0666, &bolt.Options{Timeout: 1 * time.Second})
if err != nil {
return err
Expand Down
10 changes: 9 additions & 1 deletion tsdb/engine/b1/b1.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ func NewEngine(path string, walPath string, opt tsdb.EngineOptions) tsdb.Engine
// Path returns the path the engine was initialized with.
func (e *Engine) Path() string { return e.path }

// PerformMaintenance is for periodic maintenance of the store. A no-op for b1
func (e *Engine) PerformMaintenance() {}

// Format returns the format type of this engine
func (e *Engine) Format() tsdb.EngineFormat {
return tsdb.B1Format
}

// Open opens and initializes the engine.
func (e *Engine) Open() error {
if err := func() error {
Expand Down Expand Up @@ -174,7 +182,7 @@ func (e *Engine) close() error {
func (e *Engine) SetLogOutput(w io.Writer) { e.LogOutput = w }

// LoadMetadataIndex loads the shard metadata into memory.
func (e *Engine) LoadMetadataIndex(index *tsdb.DatabaseIndex, measurementFields map[string]*tsdb.MeasurementFields) error {
func (e *Engine) LoadMetadataIndex(shard *tsdb.Shard, index *tsdb.DatabaseIndex, measurementFields map[string]*tsdb.MeasurementFields) error {
return e.db.View(func(tx *bolt.Tx) error {
// load measurement metadata
meta := tx.Bucket([]byte("fields"))
Expand Down
4 changes: 2 additions & 2 deletions tsdb/engine/b1/b1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestEngine_WritePoints(t *testing.T) {

// Create metadata.
mf := &tsdb.MeasurementFields{Fields: make(map[string]*tsdb.Field)}
mf.CreateFieldIfNotExists("value", influxql.Float)
mf.CreateFieldIfNotExists("value", influxql.Float, true)
seriesToCreate := []*tsdb.SeriesCreate{
{Series: tsdb.NewSeries(string(models.MakeKey([]byte("temperature"), nil)), nil)},
}
Expand Down Expand Up @@ -84,7 +84,7 @@ func TestEngine_WritePoints_Reverse(t *testing.T) {

// Create metadata.
mf := &tsdb.MeasurementFields{Fields: make(map[string]*tsdb.Field)}
mf.CreateFieldIfNotExists("value", influxql.Float)
mf.CreateFieldIfNotExists("value", influxql.Float, true)
seriesToCreate := []*tsdb.SeriesCreate{
{Series: tsdb.NewSeries(string(models.MakeKey([]byte("temperature"), nil)), nil)},
}
Expand Down
10 changes: 9 additions & 1 deletion tsdb/engine/bz1/bz1.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ func NewEngine(path string, walPath string, opt tsdb.EngineOptions) tsdb.Engine
// Path returns the path the engine was opened with.
func (e *Engine) Path() string { return e.path }

// PerformMaintenance is for periodic maintenance of the store. A no-op for bz1
func (e *Engine) PerformMaintenance() {}

// Format returns the format type of this engine
func (e *Engine) Format() tsdb.EngineFormat {
return tsdb.BZ1Format
}

// Open opens and initializes the engine.
func (e *Engine) Open() error {
if err := func() error {
Expand Down Expand Up @@ -176,7 +184,7 @@ func (e *Engine) close() error {
func (e *Engine) SetLogOutput(w io.Writer) {}

// LoadMetadataIndex loads the shard metadata into memory.
func (e *Engine) LoadMetadataIndex(index *tsdb.DatabaseIndex, measurementFields map[string]*tsdb.MeasurementFields) error {
func (e *Engine) LoadMetadataIndex(shard *tsdb.Shard, index *tsdb.DatabaseIndex, measurementFields map[string]*tsdb.MeasurementFields) error {
if err := e.db.View(func(tx *bolt.Tx) error {
// Load measurement metadata
fields, err := e.readFields(tx)
Expand Down
4 changes: 2 additions & 2 deletions tsdb/engine/bz1/bz1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestEngine_LoadMetadataIndex_Series(t *testing.T) {

// Load metadata index.
index := tsdb.NewDatabaseIndex()
if err := e.LoadMetadataIndex(index, make(map[string]*tsdb.MeasurementFields)); err != nil {
if err := e.LoadMetadataIndex(nil, index, make(map[string]*tsdb.MeasurementFields)); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -80,7 +80,7 @@ func TestEngine_LoadMetadataIndex_Fields(t *testing.T) {

// Load metadata index.
mfs := make(map[string]*tsdb.MeasurementFields)
if err := e.LoadMetadataIndex(tsdb.NewDatabaseIndex(), mfs); err != nil {
if err := e.LoadMetadataIndex(nil, tsdb.NewDatabaseIndex(), mfs); err != nil {
t.Fatal(err)
}

Expand Down
1 change: 1 addition & 0 deletions tsdb/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package engine
import (
_ "github.com/influxdb/influxdb/tsdb/engine/b1"
_ "github.com/influxdb/influxdb/tsdb/engine/bz1"
_ "github.com/influxdb/influxdb/tsdb/engine/tsm1"
)
Loading