Goutham Veeramachaneni
7438ed7035
Expose Intervals type for use by TombstoneReader.
...
TombstoneReader is exposed but Intervals is not.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-08-25 16:06:36 +05:30
Goutham Veeramachaneni
44e9ae38b5
Incorporate PR feedback.
...
* Expose Stone as it is used in an exported method.
* Move from tombstoneReader to []Stone for the same reason as above.
* Make WAL reading a little cleaner.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-05-26 21:26:31 +05:30
Goutham Veeramachaneni
bacb143b7e
Simplify tombstone and WAL Delete formats.
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-05-24 13:42:56 +05:30
Goutham Veeramachaneni
f29fb62fba
Make TombstoneReader a Getter.
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-05-24 11:24:24 +05:30
Goutham Veeramachaneni
9bf7aa9af1
Misc. fixes incorporating feedback.
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-05-23 18:13:30 +05:30
Goutham Veeramachaneni
3eb4119ab1
Make HeadBlock use WAL.
...
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-05-23 16:15:16 +05:30
Fabian Reinartz
39df7e2bba
Switch blocks to ULID directories, drop sequenc numbers
2017-05-18 16:09:30 +02:00
Fabian Reinartz
4862b261d0
Abstract WAL into interface
2017-05-13 17:09:26 +02:00
Fabian Reinartz
535532ca02
Export refdSample
...
The type was part of a exported method signatures and should therefore
be exported as well.
2017-05-12 17:06:26 +02:00
Julius Volz
8d1fb4fa01
Minor comment fixes and additions.
2017-04-28 15:41:42 +02:00
Fabian Reinartz
778103b450
Add liecence file and headers
2017-04-10 20:59:45 +02:00
Fabian Reinartz
10c7c9acbe
Adjust import names to new repository organisation
2017-04-04 11:27:26 +02:00
Fabian Reinartz
55ee4b5b3b
Merge branch 'master' of github.com:fabxc/tsdb
2017-03-21 10:11:39 +01:00
Fabian Reinartz
9c93f8f2aa
Fix various races
...
This fixes different race condition encoutnered when running Prometheus.
It reduces the overall performance in the synthetic benchmark a fair bit
but has no indiciations of impacting a real-world setup notably.
2017-03-20 14:45:27 +01:00
Goutham Veeramachaneni
761e4768f3
Lint and Vet Fixes
2017-03-19 21:35:01 +05:30
Fabian Reinartz
ad5812d83a
Handle WAL corruption by truncating
...
This adds handling for various corruption scenarios of the WAL.
If corruption is encountered, we truncate the WAL after the last valid
entry transparently and continue appending after the offset.
2017-03-15 11:16:16 +01:00
Fabian Reinartz
d3edfb5540
Test multiple full write/restore cylcles in WAL
2017-03-08 21:02:08 +01:00
Fabian Reinartz
cb4dde7659
Fix WAL log recovery bug
...
This fixes a bug where the last WAL file was closed after consuming it
instead of being left open for further writes.
Reloading of blocks on startup considers loading head blocks now.
2017-03-08 16:53:07 +01:00
Fabian Reinartz
55a9b5428a
Add separate head mutex
...
Introduce a seperate mutex for the head blocks to avoid a race where
a post-compaction reload may run between switching the DB's base mutex
to create a new head block in an appender.
2017-03-04 17:41:01 +01:00
Fabian Reinartz
ffb24a98f4
Add missing unlock, run debug endpoint in benchmark
2017-03-02 21:54:02 +01:00
Fabian Reinartz
f734773214
Replace per-file locking with single PID lock file
...
File locks have a multitude of problems that make them hard to use
correctly. As they are just advisory, they are only meaningful to
prevent accidents like running the same process twice.
A simple PID file lock works reliably in those cases and is simpler.
2017-02-19 13:01:19 +01:00
Fabian Reinartz
afa084920c
Use Castagnoli polynomial for CRC32s; cache them
2017-02-15 21:13:17 -08:00
Fabian Reinartz
9c7a88223e
Add full encode/decode WAL cycle test
2017-02-14 21:55:50 -08:00
Fabian Reinartz
2c97428a79
Add basic WAL tests
2017-02-14 16:12:56 -08:00
Fabian Reinartz
84e8027a8e
Close consumed WAL segments, verify checksums on read
2017-02-14 00:42:06 -08:00
Fabian Reinartz
eeb03e97e2
Add headers and format flag for WAL segments
2017-02-14 00:24:53 -08:00
Fabian Reinartz
79944a5912
Break out WAL into segment files
2017-02-13 23:53:19 -08:00
Fabian Reinartz
9ddbd64d00
Move stats into meta.json file, cleanup, docs
2017-01-19 11:22:47 +01:00
Fabian Reinartz
343dd9d94c
Fix wrong byte size in WAL base ref
2017-01-17 08:40:31 +01:00
Fabian Reinartz
9cf49f68e9
wal: use larger buffer
2017-01-16 14:18:25 +01:00
Fabian Reinartz
1c80c33e72
Fix bug of unsorted postings lists being created
...
The former approach created unordered postings list by either
map iteration of new series being unsorted (fixable) or concurrent
writers creating new series interleaved.
We switch back to generating ephemeral references for a single batch.
Newly created series have to be re-set upon the next insert.
2017-01-13 16:22:20 +01:00
Fabian Reinartz
0dffd52238
Use page writer in compaction
2017-01-09 18:47:43 +01:00
Fabian Reinartz
54f5027406
Put WAL lock down into encoder
2017-01-06 18:36:42 +01:00
Fabian Reinartz
300f4e2abf
Use separate lock for series creation
...
This uses the head block's own lock to only lock if new series were
encountered.
In the general append case we just need to hold a
2017-01-06 18:10:50 +01:00
Fabian Reinartz
71efd2e08d
Periodically fsync WAL, make head cut async
2017-01-06 15:18:06 +01:00
Fabian Reinartz
2eb544c98e
Change file names and maker parsing safer
2017-01-06 13:13:22 +01:00
Fabian Reinartz
937cdb579c
Switch to sequential block names
...
This changes block directory names from the int64 timestamp
to sequential numbering.
2017-01-06 10:45:03 +01:00
Fabian Reinartz
dbd2b21d2e
Make persistence atomic
2017-01-02 14:41:13 +01:00
Fabian Reinartz
62b8ded0a5
Rename iterator value getters to At()
2017-01-02 13:33:06 +01:00
Fabian Reinartz
7280533c42
Add basic shard metrics
2016-12-31 09:48:49 +01:00
Fabian Reinartz
a009247ab7
Add matching of empty label
2016-12-30 19:36:28 +01:00
Fabian Reinartz
8aba95048a
Rename to OpenHeadBlock
2016-12-22 20:00:24 +01:00
Fabian Reinartz
e7edae39b2
Use page buffered writer for WAL
2016-12-22 16:14:34 +01:00
Fabian Reinartz
9c6a72aadd
Load head with WALs correctly
2016-12-22 15:54:39 +01:00
Fabian Reinartz
1dde3b6d31
Add WAL decoder+loading and benchmarks
2016-12-22 15:18:33 +01:00
Fabian Reinartz
0b8c77361e
Add initial WAL writing
2016-12-22 12:05:24 +01:00