ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Thanos compactor error: pre compaction overlap check: overlaps found while gathering blocks
    Trouble Shooting 2024. 3. 3. 09:52

     

     

    Thanos compactor를 사용하다보면 종종 다음과 같은 error를 마주할 수 있다.  

    level=error ts=2018-08-08T14:49:50.954091484Z caller=main.go:160 msg="running command failed" err="compaction: pre compaction overlap check: overlaps found while gathering blocks. 
    [mint: 1532649600000, maxt: 1532656800000, range: 2h0m0s, blocks: 2]: 
    <ulid: 01CKCTVGR19AJBKHFC01YV2248, mint: 1532649600000, maxt: 1532656800000, range: 2h0m0s>, 
    <ulid: 01CKCTVG2HS86DFDTZZ2GJM26W, mint: 1532649600000, maxt: 1532656800000, range: 2h0m0s>\n[mint: 1532685600000, maxt: 1532692800000, range: 2h0m0s, blocks: 2]: 
    <ulid: 01CKDX64BMRYBJY5V9YY3WRYFS, mint: 1532685600000, maxt: 1532692800000, range: 2h0m0s>, 
    <ulid: 01CKDX6534B4P3XF6EZ49MC4ND, mint: 1532685600000, maxt: 1532692800000, range: 2h0m0s>\n[mint: 1532613600000, maxt: 1532620800000, range: 2h0m0s, blocks: 2]: 
    <ulid: 01CKBRGX8BN9S8SWG4KJ0XW3GM, mint: 1532613600000, maxt: 1532620800000, range: 2h0m0s>"

    (인터넷에 비슷하게 떠돌던 에러를 가져온 것. 실제 에러는 아님)

     

    이는 thanos를 통해서 업로드된 block들 사이의 time range가 겹쳐서 발생하는 문제로

    보통 데이터를 보내주는 쪽에서 데이터를 중복해서 보내, 데이터 중첩이 발생할 때 발생하는 듯 하다.  

     

    S3에서 겹치는 block을 삭제하면 해결할 수 있는데, 겹치는 블럭은 다음과 같이 확인할 수 있다.

    kubectl -n thanos exec -it   thanos-storegateway-0  -- \
    thanos tools bucket verify   --issues=overlapped_blocks --objstore.config-file=/conf/objstore.yml

     

    여기서 중첩된 block 쌍 중 하나의 block을 삭제한 후,

    compactor를 재기동시키면 compactor가 compaction을 정상적으로 하는 것을 확인할 수 있다.

     

    만약 compactor가 중간에 또 멈춘다면, 해당 과정을 반복해서 block을 삭제하면 된다. 

     

    compaction이 잘 된 block은 다음 커맨드를 통해서 확인할 수 있다. 

     kubectl -n thanos exec -it   thanos-storegateway-0  -- \
     thanos tools bucket inspect --objstore.config-file=/conf/objstore.yml

     

    반응형

    댓글

Designed by Tistory.