Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type errors after introduction of typedcache into bloomshipper #11902

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -610,23 +610,6 @@ local build_image_tag = '0.33.0';
'cd -',
]) { depends_on: ['clone'], when: onPRs },
make('test', container=false) { depends_on: ['clone-target-branch', 'check-generated-files'] },
run('test-target-branch', commands=['cd ../loki-target-branch && BUILD_IN_CONTAINER=false make test']) { depends_on: ['clone-target-branch'], when: onPRs },
make('compare-coverage', container=false, args=[
'old=../loki-target-branch/test_results.txt',
'new=test_results.txt',
'packages=ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki',
'> diff.txt',
]) { depends_on: ['test', 'test-target-branch'], when: onPRs },
run('report-coverage', commands=[
"total_diff=$(sed 's/%//' diff.txt | awk '{sum+=$3;}END{print sum;}')",
'if [ $total_diff = 0 ]; then exit 0; fi',
"pull=$(echo $CI_COMMIT_REF | awk -F '/' '{print $3}')",
"body=$(jq -Rs '{body: . }' diff.txt)",
'curl -X POST -u $USER:$TOKEN -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/grafana/loki/issues/$pull/comments -d "$body" > /dev/null',
], env={
USER: 'grafanabot',
TOKEN: { from_secret: github_secret.name },
}) { depends_on: ['compare-coverage'], when: onPRs },
make('lint', container=false) { depends_on: ['check-generated-files'] },
make('check-mod', container=false) { depends_on: ['test', 'lint'] },
{
Expand Down
43 changes: 1 addition & 42 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,47 +212,6 @@ steps:
environment: {}
image: grafana/loki-build-image:0.33.0
name: test
- commands:
- cd ../loki-target-branch && BUILD_IN_CONTAINER=false make test
depends_on:
- clone-target-branch
environment: {}
image: grafana/loki-build-image:0.33.0
name: test-target-branch
when:
event:
- pull_request
- commands:
- make BUILD_IN_CONTAINER=false compare-coverage old=../loki-target-branch/test_results.txt
new=test_results.txt packages=ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki
> diff.txt
depends_on:
- test
- test-target-branch
environment: {}
image: grafana/loki-build-image:0.33.0
name: compare-coverage
when:
event:
- pull_request
- commands:
- total_diff=$(sed 's/%//' diff.txt | awk '{sum+=$3;}END{print sum;}')
- if [ $total_diff = 0 ]; then exit 0; fi
- pull=$(echo $CI_COMMIT_REF | awk -F '/' '{print $3}')
- 'body=$(jq -Rs ''{body: . }'' diff.txt)'
- 'curl -X POST -u $USER:$TOKEN -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/grafana/loki/issues/$pull/comments
-d "$body" > /dev/null'
depends_on:
- compare-coverage
environment:
TOKEN:
from_secret: github_token
USER: grafanabot
image: grafana/loki-build-image:0.33.0
name: report-coverage
when:
event:
- pull_request
- commands:
- make BUILD_IN_CONTAINER=false lint
depends_on:
Expand Down Expand Up @@ -2113,6 +2072,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: 457592d17208477ceb480f81dbdb88f7b95a5ad015c88d9d6fed06c2422a52f9
hmac: 51861919f0ba5370a152bdb9267828c742f2042819fb01388c6d23bf44e3cbb7

...
8 changes: 5 additions & 3 deletions pkg/storage/stores/shipper/bloomshipper/shipper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ func TestBloomShipper_ForEach(t *testing.T) {
for i := 0; i < len(blockRefs); i++ {
s := store.stores[0]
key := s.Block(blockRefs[i]).Addr()
dir, found := s.fetcher.blocksCache.Get(context.Background(), key)
require.True(t, found)
require.Equal(t, int32(0), dir.refCount.Load())
found, dirs, missing, err := s.fetcher.blocksCache.Fetch(context.Background(), []string{key})
require.NoError(t, err)
require.Equal(t, 1, len(found))
require.Equal(t, 0, len(missing))
require.Equal(t, int32(0), dirs[0].refCount.Load())
}
}

Expand Down
Loading