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

Blooms/integration fixes #11979

Merged
merged 14 commits into from
Feb 19, 2024
Merged

Blooms/integration fixes #11979

merged 14 commits into from
Feb 19, 2024

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Feb 16, 2024

A few more fixes/improvements while running & debugging blooms

@owen-d owen-d requested a review from a team as a code owner February 16, 2024 20:34
@owen-d owen-d force-pushed the blooms/integration-fixes branch from 62c6cd2 to 5ee3d5a Compare February 18, 2024 20:08
@owen-d owen-d force-pushed the blooms/integration-fixes branch from 5ee3d5a to 0f9920c Compare February 18, 2024 20:11
@owen-d owen-d force-pushed the blooms/integration-fixes branch from 9fd015e to 2d09d20 Compare February 18, 2024 20:38
@@ -92,6 +92,15 @@ func (s *SimpleBloomController) compactTenant(
return errors.Wrap(err, "failed to get metas")
}

level.Debug(logger).Log("msg", "found relevant metas", "metas", len(metas))

// fetch all metas overlapping all metas overlapping our ownership range so we can safely
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// fetch all metas overlapping all metas overlapping our ownership range so we can safely
// fetch all metas overlapping our ownership range so we can safely

@@ -226,7 +226,7 @@ func TestMergeBuilder(t *testing.T) {
)

// Ensure that the merge builder combines all the blocks correctly
mergeBuilder := NewMergeBuilder(dedupedBlocks(blocks), storeItr, pop)
mergeBuilder := NewMergeBuilder(dedupedBlocks(blocks), storeItr, pop, NewMetrics(nil))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't a registerer be passed to NewMetrics()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it short circuits with nil

@@ -77,7 +81,7 @@ func (defaultKeyResolver) Block(ref BlockRef) Location {
ref.TenantID,
BlocksPrefix,
ref.Bounds.String(),
fmt.Sprintf("%d-%d-%x", ref.StartTimestamp, ref.EndTimestamp, ref.Checksum),
fmt.Sprintf("%d-%d-%x%s", ref.StartTimestamp, ref.EndTimestamp, ref.Checksum, extTarGz),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@chaudum chaudum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved to unblock

level.Debug(logger).Log("msg", "found relevant metas", "metas", len(metas))

// fetch all metas overlapping all metas overlapping our ownership range so we can safely
// check which metas can be deleted even if they only partially overlap out ownership range
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// check which metas can be deleted even if they only partially overlap out ownership range
// check which metas can be deleted even if they only partially overlap our ownership range

return errors.Wrap(err, "failed to delete block")
}
}
level.Debug(logger).Log("msg", "removed outdated block", "block", block.String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have a metric to track how many blocks/metas are deleted

@@ -236,8 +236,8 @@ func NewTSDBStores(
if err != nil {
return nil, errors.Wrap(err, "failed to create object client")
}
prefix := path.Join(cfg.IndexTables.PathPrefix, cfg.IndexTables.Prefix)
res.stores[i] = NewBloomTSDBStore(storage.NewIndexStorageClient(c, prefix))
// prefix := path.Join(cfg.IndexTables.PathPrefix, cfg.IndexTables.Prefix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this?

}

const chunkIndexedTypeIterated = "iterated"
const chunkIndexedTypeCopied = "copied"

func NewMetrics(r prometheus.Registerer) *Metrics {
return &Metrics{
sbfCreationTime: promauto.With(r).NewCounter(prometheus.CounterOpts{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably be a histogram

Signed-off-by: Owen Diehl <[email protected]>
@owen-d owen-d enabled auto-merge (squash) February 19, 2024 16:51
@owen-d owen-d merged commit 85f7baa into grafana:main Feb 19, 2024
8 checks passed
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants