Commit b8c9dcf
bucket verify: repair out of order labels (#964)
* bucket verify: repair out of order labels
* verify repair: correctly order series in the index on rewrite
When we have label sets that are not in the correct order, fixing that
changes the order of the series in the index. So the index must be
rewritten in that new order. This makes this repair tool take up a
bunch more memory, but produces blocks that verify correctly.
* Fix the TSDB block safe-delete function
The directory name must be the block ID name exactly to verify. A temp
directory or random name will not work here.
* verify repair: fix duplicate chunk detection
Pointer/reference logic error was eliminating all chunks for a series in
a given TSDB block that wasn't the first chunk. Chunks are now
referenced correctly via pointers.
* PR feedback: use errors.Errorf() instead of fmt.Errorf()
* Use errors.New()
Some linters catch errors.Errorf() as its not really part of the errors
package.
* Liberally comment this for loop
We're comparing items by pointers, using Go's range variables is
misleading here and we need not fall into the same trap.
* Take advantage of sort.Interface
This prevents us from having to re-implement label sorting.
* PR Feedback: Comments are full sentences.1 parent d436a04 commit b8c9dcf
File tree
3 files changed
+57
-23
lines changed- cmd/thanos
- pkg
- block
- verifier
3 files changed
+57
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
567 | 572 | | |
568 | | - | |
| 573 | + | |
569 | 574 | | |
570 | 575 | | |
571 | 576 | | |
| |||
575 | 580 | | |
576 | 581 | | |
577 | 582 | | |
578 | | - | |
579 | | - | |
| 583 | + | |
| 584 | + | |
580 | 585 | | |
581 | 586 | | |
582 | 587 | | |
583 | 588 | | |
584 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
585 | 595 | | |
586 | 596 | | |
587 | 597 | | |
| |||
609 | 619 | | |
610 | 620 | | |
611 | 621 | | |
| 622 | + | |
612 | 623 | | |
613 | 624 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | 625 | | |
| 626 | + | |
| 627 | + | |
618 | 628 | | |
619 | 629 | | |
620 | 630 | | |
621 | 631 | | |
622 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
623 | 636 | | |
624 | 637 | | |
625 | 638 | | |
| |||
636 | 649 | | |
637 | 650 | | |
638 | 651 | | |
639 | | - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
640 | 671 | | |
641 | 672 | | |
642 | | - | |
| 673 | + | |
643 | 674 | | |
644 | 675 | | |
645 | 676 | | |
646 | | - | |
| 677 | + | |
647 | 678 | | |
648 | 679 | | |
649 | | - | |
| 680 | + | |
650 | 681 | | |
651 | 682 | | |
652 | 683 | | |
653 | | - | |
| 684 | + | |
654 | 685 | | |
655 | 686 | | |
656 | 687 | | |
657 | 688 | | |
658 | 689 | | |
659 | 690 | | |
660 | 691 | | |
661 | | - | |
| 692 | + | |
662 | 693 | | |
663 | 694 | | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | 695 | | |
668 | 696 | | |
669 | 697 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
40 | | - | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
0 commit comments