-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
The TSM storage engine #4308
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 8d16c96
Add comment about encoding float
pauldix 041e7be
WIP: engine work
pauldix 4e2dfd7
WIP: finish basics of PD1. IT WORKS! (kind of)
pauldix f37df11
WIP: more WAL work
pauldix 318bc72
Add full durability to WAL and flush on startup
pauldix 95f9e16
Update encoding test to work with new interface.
pauldix 7508568
Add memory settings and WAL backpressure
pauldix 38f9b29
Update engine to put index at the end of data files
pauldix 1b57b80
Add test for close and restart of engine and fix errors.
pauldix ea85f80
Update wal to only open new segment file on flush if its not an idle …
pauldix ed70551
Update to work with new cursor definitiono and Point in models
pauldix 0aa6847
Make writes to historical areas possible
pauldix 33d28e1
Ensure we don't have duplicate values. Fix panic in compaction.
pauldix 3aba709
Add multicursor to combine wal and index
pauldix 4db2e5c
Add compaction and time range based write locks.
pauldix a103432
Handle hash collisions on keys
pauldix 17ed693
Add support for multiple fields
pauldix f1ba618
Fix wal flushing, compacting, and write lock
pauldix 8444e05
Add PerformMaintenance to store for flushes and compactions.
pauldix 68d03e8
Make compaction run at most at set duration.
pauldix 9e630f8
Ensure data files can't be deleted while query is running.
pauldix eb24c0d
Add recover to maintenance. Change snapshot writer to not use bolt on…
pauldix 9031804
Update tests to use transactions. Add test for single series 10k points.
pauldix ca2a13c
Update stress to use second timestamps and less random floats.
pauldix 4fcc61c
Ensure we have files when iterating in cursor
jwilder 938bae9
Fix go vet errors
jwilder 57b0a27
Allow influx_stress to use small data sizes
jwilder 19877a6
Add time and float compression
jwilder bf74c7c
Add int64 compression
jwilder fce01a2
Use zigzag encoding for timestamp deltas
jwilder 8ce3d75
Reduce memory allocations
jwilder 071739b
Fix run length encoding check
jwilder 5a49e1a
Add test assertions for time encoding type
jwilder 8d2ecb5
Remove unnecessary allocations from int64 decoder
jwilder 7fe9673
Keep track of the type of the block encoded
jwilder 6c0f53d
Add a compressed boolean encoding
jwilder 3cbd4b1
Update simple8b api usage
jwilder 3ea1b5e
Fix deadlock in pd1_test.go
jwilder 2492218
Add documentation about compression
jwilder c0eba04
Rename float encoding tests
jwilder 72fa3dd
Update WAL to deduplicate values on Cursor query.
pauldix 6c2bef6
Add logging to pd1
pauldix 4937ae8
Fix panic when data file has small index
pauldix f29c4c8
Add compressed string encoding
jwilder c27de6f
Add test with duplicate timestamps
jwilder 9b84a20
Fix bugs with writing old data and compaction.
pauldix c1accf7
Handle partial reads when loading WAL
jwilder 01b5b92
Fix compaction and multi-write bugs.
pauldix b826f8d
Remove zig zag encoding from timestamp encoder
jwilder 5326ac4
Fix go vet
jwilder c0aa5f0
Implement reverse cursor direction on pd1
pauldix 8fa187c
Add deletes to new storage engine
pauldix 5fe3c4e
Rename storage engine to tsm1, for Time Structured Merge Tree!
pauldix 316f74c
Cleanup after pd1 -> tsm1 name change.
pauldix c8d8ebc
Fix TestStoreOpenShardCreateDelete
jwilder 5800bde
Disable copier test
jwilder 1a174de
Fix go vet errors
jwilder c2e8922
Move compression encoding constants to encoders
jwilder 33ac598
Propogate all encoding errors to engine
jwilder 6f299aa
Add db crash recovery
pauldix 4d1ce61
do not include empty tags in hash
parisholley 851a53f
Merge pull request #4320 from parisholley/newengineEmpty
pauldix 6504df6
Fix comment typos
jwilder 1448db0
Make DecodeBlock panic if block size is too small
jwilder e9285f3
Avoid duplicating values slice when encoding
jwilder a0841c4
Updates based on @otoolp's PR comments
pauldix ae36c57
Fix deletes not kept if shutdown before flush on tsm1
pauldix a542d55
Merge pull request #4333 from influxdb/retry_mon_create
otoolep e3b30e3
Updates based on PR feedback
pauldix fb2a1cb
WIP: skeleton for encoding for new engine
pauldix 12ea1cb
Add comment about encoding float
pauldix 7555ccb
WIP: engine work
pauldix 2ba032b
WIP: finish basics of PD1. IT WORKS! (kind of)
pauldix 82e1be7
WIP: more WAL work
pauldix 2100e66
Add full durability to WAL and flush on startup
pauldix 5e59cb9
Update encoding test to work with new interface.
pauldix fe1f9a5
Add memory settings and WAL backpressure
pauldix c5f6c57
Update engine to put index at the end of data files
pauldix 7c8ab4f
Add test for close and restart of engine and fix errors.
pauldix 365a631
Update wal to only open new segment file on flush if its not an idle …
pauldix 982c28b
Update to work with new cursor definitiono and Point in models
pauldix 0770ccc
Make writes to historical areas possible
pauldix 7baba84
Ensure we don't have duplicate values. Fix panic in compaction.
pauldix 2eb2a64
Add multicursor to combine wal and index
pauldix 48069e7
Add compaction and time range based write locks.
pauldix 667b3e6
Handle hash collisions on keys
pauldix 6c94e73
Add support for multiple fields
pauldix d694454
Fix wal flushing, compacting, and write lock
pauldix 1c8eac1
Add PerformMaintenance to store for flushes and compactions.
pauldix b1bdb4f
Make compaction run at most at set duration.
pauldix 0fd116d
Ensure data files can't be deleted while query is running.
pauldix 0b33a71
Add recover to maintenance. Change snapshot writer to not use bolt on…
pauldix db4ad33
Update tests to use transactions. Add test for single series 10k points.
pauldix 12e14f1
Update stress to use second timestamps and less random floats.
pauldix 88248f3
Ensure we have files when iterating in cursor
jwilder 112a03f
Fix go vet errors
jwilder 42e1bab
Add time and float compression
jwilder 4a37ba8
Add int64 compression
jwilder ce1d45e
Use zigzag encoding for timestamp deltas
jwilder 092689c
Reduce memory allocations
jwilder e42d866
Fix run length encoding check
jwilder 95046c1
Add test assertions for time encoding type
jwilder 731ae27
Remove unnecessary allocations from int64 decoder
jwilder 1196587
Keep track of the type of the block encoded
jwilder cb23f5a
Add a compressed boolean encoding
jwilder 7e0df18
Update simple8b api usage
jwilder 2da52ec
Fix deadlock in pd1_test.go
jwilder a4d9216
Add documentation about compression
jwilder 9f9692a
Rename float encoding tests
jwilder c1213ba
Update WAL to deduplicate values on Cursor query.
pauldix be011b8
Add logging to pd1
pauldix 861a15b
Fix panic when data file has small index
pauldix c47d145
Add compressed string encoding
jwilder 5d938d0
Add test with duplicate timestamps
jwilder 3332236
Fix bugs with writing old data and compaction.
pauldix 2366baa
Handle partial reads when loading WAL
jwilder a2b139e
Fix compaction and multi-write bugs.
pauldix d9499f0
Remove zig zag encoding from timestamp encoder
jwilder dbf6228
Fix go vet
jwilder 4beca1a
Implement reverse cursor direction on pd1
pauldix 0a11a2f
Add deletes to new storage engine
pauldix 594253c
Rename storage engine to tsm1, for Time Structured Merge Tree!
pauldix d47ddb5
Cleanup after pd1 -> tsm1 name change.
pauldix ab791ba
Fix TestStoreOpenShardCreateDelete
jwilder 5d9b89d
Disable copier test
jwilder b1a57e1
Fix go vet errors
jwilder 4c54c78
Move compression encoding constants to encoders
jwilder 1d754db
Propogate all encoding errors to engine
jwilder d9f94bd
Add db crash recovery
pauldix 36898f9
do not include empty tags in hash
parisholley b044970
Fix comment typos
jwilder cb28dab
Make DecodeBlock panic if block size is too small
jwilder c6f2f9c
Avoid duplicating values slice when encoding
jwilder bb398da
Updates based on @otoolp's PR comments
pauldix 26a93ec
Fix deletes not kept if shutdown before flush on tsm1
pauldix 267f34b
Updates based on PR feedback
pauldix 27d0db3
Merge branch 'pd-storage-engine' of github.com:influxdb/influxdb into…
pauldix be477b2
Fix cursor bug on index
pauldix 41e3294
Fix panic: assignment to entry in nil map
jwilder 40ff4f4
Change default to bz1
pauldix b113081
Only limit field count for non-tsm engines
pauldix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 intsm1
will allow graceful exit. Not checking it and assuming itstsm1
may result in hard-to-understand crashes on initialization.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.