Skip to content

Commit

Permalink
Added block.MetaFetcher logic for resilient sync of meta files. (#1934)
Browse files Browse the repository at this point in the history
* Created transactional GaugeVec for easy atomic Gauge change.

Signed-off-by: Bartek Plotka <[email protected]>

* Added single block.MetaFetcher logic for resilient sync of meta files.

This is meant to replace many inconsistent meta.json syncs places in other components.

Signed-off-by: Bartlomiej Plotka <[email protected]>

* Addressed comments.

Signed-off-by: Bartlomiej Plotka <[email protected]>
  • Loading branch information
bwplotka authored Jan 6, 2020
1 parent d9764fb commit 4d1cc62
Show file tree
Hide file tree
Showing 11 changed files with 1,081 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan
We use *breaking* word for marking changes that are not backward compatible (relates only to v0.y.z releases.)

## Unreleased

### Fixed

- [#1856](https://github.com/thanos-io/thanos/pull/1856) Receive: close DBReadOnly after flushing to fix a memory leak.
Expand Down
7 changes: 1 addition & 6 deletions pkg/block/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
"github.com/oklog/ulid"
)

// NOTE(bplotka): For block packages we cannot use testutil, because they import block package. Consider moving simple
// testutil methods to separate package.
func TestIsBlockDir(t *testing.T) {
for _, tc := range []struct {
input string
Expand Down Expand Up @@ -58,10 +56,7 @@ func TestIsBlockDir(t *testing.T) {
} {
t.Run(tc.input, func(t *testing.T) {
id, ok := IsBlockDir(tc.input)
if ok != tc.bdir {
t.Errorf("expected block dir != %v", tc.bdir)
t.FailNow()
}
testutil.Equals(t, tc.bdir, ok)

if id.Compare(tc.id) != 0 {
t.Errorf("expected %s got %s", tc.id, id)
Expand Down
Loading

0 comments on commit 4d1cc62

Please sign in to comment.