Ben Kochie
269e7c8091
Fix golint issues.
...
Signed-off-by: Ben Kochie <superq@gmail.com>
5 years ago
Ganesh Vernekar
e64a149984
Close Head in DBReadOnly.FlushWAL ( #7022 )
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
李国忠
261cbab8e9
remove Unused parameter 'reg' in wal.Open function ( #6941 )
...
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
5 years ago
Bartlomiej Plotka
a20bebf7eb
Moved readyStorage to main.
...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Bartlomiej Plotka
59c9d6ef45
Addressed Brian's comments, moved metrics to main.go
...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Bartlomiej Plotka
cfba92a133
Addressed comments.
...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Bartlomiej Plotka
2cf637fbf5
Addressed comments.
...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Bartlomiej Plotka
34426766d8
Unify Iterator interfaces. All point to storage now.
...
This is part of https://github.com/prometheus/prometheus/pull/5882 that can be done to simplify things.
All todos I added will be fixed in follow up PRs.
* querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged
with storage interface.go. All imports that.
* querier.SeriesIterator replaced by chunkenc.Iterator
* Added chunkenc.Iterator.Seek method and tests for xor implementation (?)
* Since we properly handle SelectParams for Select methods I adjusted min max
based on that. This should help in terms of performance for queries with functions like offset.
* added Seek to deletedIterator and test.
* storage/tsdb was removed as it was only a unnecessary glue with incompatible structs.
No logic was changed, only different source of abstractions, so no need for benchmarks.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Zhou Hao
e628fd7735
fix comments spelling ( #6829 )
...
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
5 years ago
Ganesh Vernekar
6f1d2ec73e
Break DB.Compact and DB.compactHead and DB.compactBlocks. Add DB.CompactHead.
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
Thor
17d8c49919
made stripe size configurable ( #6644 )
...
Signed-off-by: Thor <thansen@digitalocean.com>
5 years ago
Ganesh Vernekar
e0733a99e3
Expose DB.Compact()
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
Julien Pivotto
398bd84d6f
small tsdb fixes ( #6616 )
...
* tsdb: register compactions_skipped_total
That metric was not registered.
I also reordered the metrics in the list.
* tsdb: display correct error when WAL can't be read
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Josh Soref
91d76c8023
Spelling ( #6517 )
...
* spelling: alertmanager
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: attributes
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: autocomplete
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: bootstrap
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: caught
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: chunkenc
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: compaction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: corrupted
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: deletable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: expected
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: fine-grained
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: initialized
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: iteration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: javascript
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: multiple
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: number
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: overlapping
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: possible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: postings
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: procedure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: programmatic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: queuing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: querier
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: repairing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: received
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: reproducible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: retention
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: sample
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: segements
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: semantic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: software [LICENSE]
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: staging
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: timestamp
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: unfortunately
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: uvarint
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: subsequently
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: ressamples
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
5 years ago
johncming
0ae048ff78
tsdb: add error details in log. ( #6415 )
...
Signed-off-by: johncming <johncming@yahoo.com>
5 years ago
Dipack P Panjabi
e2dd5b61ef
Added CreateBlock and CreateHead functions to new file ( #6331 )
...
* Added CreateBlock and CreateHead functions to new file to make it reusable across packages.
Signed-off-by: Dipack P Panjabi <dipack.panjabi@gmail.com>
5 years ago
Tom Wilkie
de0a772b8e
Port tsdb to use pkg/labels. ( #6326 )
...
* Port tsdb to use pkg/labels.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Get tests passing.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Remove useless cast.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Appease linters.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
Dipack P Panjabi
ce7bab04dd
Compute WAL size and use it during retention size checks ( #5886 )
...
* Compute WAL size and account for it when applying the retention settings.
Signed-off-by: Dipack P Panjabi <dpanjabi@hudson-trading.com>
5 years ago
Krasi Georgiev
81d284f806
Merge the 2.13 release branch to master ( #6117 )
5 years ago
Chris Marchbanks
6970f725c9
Fix panic in ARM builds of Prometheus ( #6110 )
...
An extra sync.Pool was added during a refactor which caused some 64 bit,
atomically accessed variables to no longer be 64 bit aligned. By moving
all atomically accessed variables to the beginning of the struct they
are guaranteed to be 64 bit aligned.
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
5 years ago
陈谭军
103f26d188
fix the wrong word ( #6069 )
...
Signed-off-by: chentanjun <2799194073@qq.com>
5 years ago
Lucas Servén Marín
8ab628b354
tsdb: allow readonly DB to create flush WAL ( #6006 )
...
This PR gives the readonly DB the ability to create blocks from the WAL.
In order to implement this, we modify DBReadOnly.Blocks() to return an
empty slice and no error if no blocks are found.
xref: https://github.com/prometheus/tsdb/issues/346#issuecomment-520786524
Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
5 years ago
Ganesh Vernekar
5ecef3542d
Cleanup after merging tsdb into prometheus
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
Ganesh Vernekar
7cf09b0395
Moving tsdb into its own subdirectory
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
5 years ago
Yao Zengzeng
d5b3f07043
add metric for tsdb size retention bytes ( #667 )
...
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
5 years ago
Krasi Georgiev
6f9bbc7253
Open db in Read only mode ( #588 )
...
* Added db read only open mode and use it for the tsdb cli.
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
5 years ago
Krasi Georgiev
31f7990d1d
Re-encode chunks that are still being appended to when snapshoti… ( #641 )
...
* re encode all head chunks outside the time range.
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
5 years ago
Krasi Georgiev
8d86e921cf
refactor block size calculation ( #637 )
...
* refactor block size calculation
The block size is kept in memory and not in the meta file anymore.
It now includes the size of the meta file itself for a more
correct block size.
It fixes a bug where the size didn't change when calling `block.Delete()`.
Adds a dedicated test to ensure correct block sizes.
This allows opening a db in a read only mode as it doesn't write to the meta file anymore.
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
5 years ago
Chris Marchbanks
b40cc43958
Provide option to compress WAL records ( #609 )
...
In running Prometheus instances, compressing the records was shown to
reduce disk usage by half while incurring a negligible CPU cost.
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
6 years ago
Krasi Georgiev
69740485c1
move the wal repair logic in db.Open ( #633 )
...
* move the wal repair logic in db.Open
This is to allow opening a wal in a read oly mode without triggering a
repair.
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
6 years ago
Krasi Georgiev
882162d5b9
fix the "failed compaction" metric. ( #613 )
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
8eeb70fee1
remove Fsync workaround for macos. ( #574 )
...
since golang 1.12 no special handling is required for file.Sync()
@pborzenkov thanks for the pointer.
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
zhulongcheng
aed16621c0
Add Head.compactable method ( #542 )
...
* Add Head.compactable method
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
6 years ago
Vishnunarayan K I
7757fe6f21
Added ability to create db with NopWal ( #519 )
...
Signed-off-by: Vishnunarayan K I <appukuttancr@gmail.com>
6 years ago
Krasi Georgiev
c3ffdf1a99
Test createBlock and check all os.RemoveAll in the tests for errors. ( #549 )
...
Testing that createBlock creates blocks that can be opened.
and checking the os.RemoveAll for errors will catch errors for un-closed files under windows.
Many missing .Close() calls were added for fixing failing os.RemoveAll
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
naivewong
dd0d3c6f02
Several small fixes ( #550 )
...
`if ds[i].meta.MinTime < t0 || ds[i].meta.MaxTime > t0+tr `, ds[i].meta.MinTime is always larger or equal to t0, so no need for this check.
`ulid.Parse` only checks if the length is 26. So changed to using `ulid.ParseStrict` to also check the validity of ulid.
6 years ago
zhulongcheng
8feb67e630
Update Appender.AddFast method comment ( #551 )
...
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
6 years ago
Krasi Georgiev
ab8476dd06
Release 0.6.0 ( #537 )
6 years ago
Ganesh Vernekar
28c73f531f
Make vertical compaction and query merge optional
...
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Ganesh Vernekar
c59ed492b2
Vertical query merging and compaction ( #370 )
...
* Vertical series iterator
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Select overlapped blocks first in compactor Plan()
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Added vertical compaction
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Code cleanup and comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix tests
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Add benchmark for compaction
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Perform vertical compaction only when blocks are overlapping.
Actions for vertical compaction:
* Sorting chunk metas
* Calling chunks.MergeOverlappingChunks on the chunks
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Benchmark for vertical compaction
* BenchmarkNormalCompaction => BenchmarkCompaction
* Moved the benchmark from db_test.go to compact_test.go
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Benchmark for query iterator and seek for non overlapping blocks
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Vertical query merge only for overlapping blocks
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Simplify logging in Compact(...)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Updated CHANGELOG.md
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Calculate overlapping inside populateBlock
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* MinTime and MaxTime for BlockReader.
Using this to find overlapping blocks in populateBlock()
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Sort blocks w.r.t. MinTime in reload()
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Log about overlapping in LeveledCompactor.write() instead of returning bool
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Log about overlapping inside LeveledCompactor.populateBlock()
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Refactor createBlock to take optional []Series
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* review1
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
* Updated CHANGELOG and minor nits
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* nits
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Updated CHANGELOG
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Refactor iterator and seek benchmarks for Querier.
Also has as overlapping blocks.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Additional test case
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* genSeries takes optional labels. Updated BenchmarkQueryIterator and BenchmarkQuerySeek.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Split genSeries into genSeries and populateSeries
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Check error in benchmark
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Warn about overlapping blocks in reload()
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago
Krasi Georgiev
bf2239079d
refactor multi errors
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
c3a5c1d891
refactor error handling
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
45acaadd81
review changes
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
6c34eb8b63
nits
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
315de4c782
fix windows tests
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
b521559c3b
do a proper cleanup for a failed reload after a compaction
...
a failed reload immediately after a compaction should delete the
resulting block to avoid creating blocks with the same time range.
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Brian Brazil
5db162568b
Remove _total from prometheus_tsdb_storage_blocks_bytes ( #506 )
...
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
6 years ago
Krasi Georgiev
9874377ead
nits
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Krasi Georgiev
921f82cfc1
WIP
...
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
6 years ago
Ganesh Vernekar
1a9d08adc5
Don't write empty blocks ( #374 )
...
* Dont write empty blocks when a compaction results in a block with no samples.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
6 years ago