-
Notifications
You must be signed in to change notification settings - Fork 529
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
Store-gateway: Add no-compact column on store-gateway/tenants admin UI #6848
Conversation
pkg/storegateway/blocks.gohtml
Outdated
@@ -79,6 +82,14 @@ | |||
{{ end }} | |||
</td> | |||
{{ end }} | |||
{{ if $page.ShowNoCompact }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's always show no compact markers when listing blocks via web.
pkg/util/listblocks/listblocks.go
Outdated
} | ||
} | ||
|
||
metas, err = fetchMetas(ctx, bkt, metaPaths) | ||
return metas, deletionTimes, err | ||
return metas, deletionTimes, noCompactBlocks, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to fetch "reasons" and timestamps from no-compact markers, and return those.
c12106b
to
cf791b9
Compare
return times, concurrency.ForEachJob(ctx, len(deletionMarkers), concurrencyLimit, func(ctx context.Context, idx int) error { | ||
r, err := bkt.Get(ctx, deletionMarkers[idx]) | ||
return details, concurrency.ForEachJob(ctx, len(markers), concurrencyLimit, func(ctx context.Context, idx int) error { | ||
r, err := bkt.Get(ctx, markers[idx]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reuse block.ReadMarker()
? it looks like it's doing pretty much the same job as here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function was there, i didn't look into make it different because of the change size, it is not really relevant to the PR title. I see the difference between listblocks and other cases we use ReadMarker, is that here we do execute the read in concurrency. I would prefer not to change that in this PR, if possible it could be a good general refectory task for following.
b86c0b3
to
6a9ac39
Compare
6a9ac39
to
717060a
Compare
276aac9
to
38429a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some post-merge comments.
} | ||
|
||
const concurrencyLimit = 32 | ||
|
||
func fetchDeletionTimes(ctx context.Context, bkt objstore.BucketReader, deletionMarkers []string) (map[ulid.ULID]time.Time, error) { | ||
func fetchMarkerDetails[MARKER_TYPE block.Marker](ctx context.Context, bkt objstore.BucketReader, markers []string) (map[ulid.ULID]MARKER_TYPE, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All generic types are "types", there's no need to include that in the name. I'd suggest to shorten MARKER_TYPE
to just M
.
@@ -149,10 +159,9 @@ func (s *StoreGateway) BlocksHandler(w http.ResponseWriter, req *http.Request) { | |||
}, blocksPageTemplate, req) | |||
} | |||
|
|||
func formatTimeIfNotZero(t time.Time, format string) string { | |||
if t.IsZero() { | |||
func formatTimeIfNotZero(t int64, format string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use strong types instead of "integers" for times. Perhaps we could use *time.Time
in richMeta
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #6883
} | ||
} | ||
|
||
noCompactDetails, err = fetchMarkerDetails[block.NoCompactMark](ctx, bkt, noCompactMarkerFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only load no-compact markers when they are displayed.
In store-gateway UI, I suggested to always display them, but in listblocks
we could have provided an option instead.
@@ -140,7 +141,7 @@ func printMetas(metas map[ulid.ULID]*block.Meta, deletedTimes map[ulid.ULID]time | |||
fmt.Fprintln(tabber) | |||
|
|||
for _, b := range blocks { | |||
if !cfg.showDeleted && !deletedTimes[b.ULID].IsZero() { | |||
if !cfg.showDeleted && deleteMarkerDetails[b.ULID].DeletionTime != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change DeletionTime
to time.Time
and provide correct marshal/unmarshal functions.
if val, ok := noCompactMarkerDetails[b.ULID]; ok { | ||
fmt.Fprintf(tabber, "%v\t", []string{ | ||
fmt.Sprintf("Time: %s", time.Unix(val.NoCompactTime, 0).UTC().Format(time.RFC3339)), | ||
fmt.Sprintf("Reason: %s", val.Reason)}) | ||
} else { | ||
fmt.Fprintf(tabber, "\t") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the output for this look like?
What this PR does
This PR introduces a new filter 'no-compact' in the admin UI for block filtering. Currently, we have various filters available for markers, but this addition extends functionality by enabling the display of blocks marked with 'no-compact'. Subsequent PRs will build upon this enhancement to provide users with the capability to mark blocks directly through the UI instead of CLI.
Test in local, how it looks like on UI
Which issue(s) this PR fixes or relates to
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.