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

backupccl: hookup tracing aggregator events from the restore job #108359

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

adityamaru
Copy link
Contributor

This change builds on top of #107994 and wires up each restore
data processor to emit TracingAggregatorEvents to the job coordinator.
These events are periodically flushed to files in the job_info
table and are consumable via the DBConsole Job Details page.

Fixes: #100126
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@adityamaru adityamaru marked this pull request as ready for review August 14, 2023 12:54
@adityamaru adityamaru requested review from a team as code owners August 14, 2023 12:54
@adityamaru adityamaru requested review from a team August 14, 2023 12:54
@adityamaru adityamaru requested a review from a team as a code owner August 14, 2023 12:54
@adityamaru adityamaru requested review from lidorcarmel, ericharmeling, mgartner, dt and stevendanna and removed request for a team, lidorcarmel, ericharmeling and mgartner August 14, 2023 12:54
Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

LGTM overall

Comment on lines 695 to 701
msg, ok := event.(protoutil.Message)
if !ok {
// This should never happen but if it does skip the aggregated event.
log.Warningf(ctx, "event is not a protoutil.Message: %T", event)
return
}
data := make([]byte, msg.Size())
if _, err := msg.MarshalTo(data); err != nil {
// This should never happen but if it does skip the aggregated event.
log.Warningf(ctx, "failed to unmarshal aggregated event: %v", err.Error())
return
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this could be a method on bulkutil.TracingAggregatorEvent so that it can be shared?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i made it a util method instead of putting it on the interface since all events would have the same impl

pkg/ccl/backupccl/restore_job.go Outdated Show resolved Hide resolved
pkg/kv/bulk/bulkpb/ingestion_performance_stats.go Outdated Show resolved Hide resolved
This change builds on top of cockroachdb#107994 and wires up each restore
data processor to emit TracingAggregatorEvents to the job coordinator.
These events are periodically flushed to files in the `job_info`
table and are consumable via the DBConsole Job Details page.

Fixes: cockroachdb#100126
Release note: None
@blathers-crl
Copy link

blathers-crl bot commented Aug 24, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@adityamaru
Copy link
Contributor Author

TFTR!

bors r=stevendanna

@craig
Copy link
Contributor

craig bot commented Aug 25, 2023

Build succeeded:

@craig craig bot merged commit 155dc00 into cockroachdb:master Aug 25, 2023
7 of 8 checks passed
@adityamaru adityamaru deleted the wireup-ingestion-stats branch August 25, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jobsprofiler: periodically persist aggregated stats during job execution
3 participants