Skip to content

backup: refactor backup telemetry to use besteffort#159061

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
andrew-r-thomas:besteffort-backup-telemetry-refactoring
Jan 22, 2026
Merged

backup: refactor backup telemetry to use besteffort#159061
craig[bot] merged 2 commits intocockroachdb:masterfrom
andrew-r-thomas:besteffort-backup-telemetry-refactoring

Conversation

@andrew-r-thomas
Copy link
Contributor

Previously backup telemetry used explicit logging and now uses the besteffort
package. The backups hooks goroutine handling was cleaned up as part of
besteffort refactoring.

Release note: None
Part of: #152677

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andrew-r-thomas
Copy link
Contributor Author

this is stacked on #159057

@andrew-r-thomas andrew-r-thomas force-pushed the besteffort-backup-telemetry-refactoring branch 2 times, most recently from 2e572f7 to b650bca Compare December 12, 2025 18:06
@blathers-crl
Copy link

blathers-crl bot commented Dec 12, 2025

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.

@andrew-r-thomas andrew-r-thomas force-pushed the besteffort-backup-telemetry-refactoring branch 3 times, most recently from 2314aa7 to c21899f Compare December 15, 2025 02:15
@andrew-r-thomas andrew-r-thomas marked this pull request as ready for review December 15, 2025 12:57
@andrew-r-thomas andrew-r-thomas requested a review from a team as a code owner December 15, 2025 12:57
Copy link
Collaborator

@jeffswenson jeffswenson left a comment

Choose a reason for hiding this comment

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

LGTM

log.StructuredEvent(ctx, severity.INFO, &event)
besteffort.Warning(ctx, "log-backup-telemetry", func(ctx context.Context) error {
event, err := createBackupRecoveryEvent(ctx, initialDetails, jobID)
if err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the err == nil check is correct, but I think its best to stick to the if err != nil { return err} pattern if possible even if its one more lines of code. It's way more common, which makes the code a little easier to read.

event, err := createBackupRecoveryEvent(...)
if err != nil {
   return err
}
log.StructuredEvent(...)
return nil
}

@andrew-r-thomas andrew-r-thomas force-pushed the besteffort-backup-telemetry-refactoring branch from c21899f to b3d7fde Compare January 22, 2026 00:15
jeffswenson and others added 2 commits January 21, 2026 19:32
This adds a package that can be used to mark blocks of code as best
effort. This is intended to replace most instances of error logging in
the dr codebase.

Fixes: cockroachdb#152677
Previously backup telemetry used explicit logging and now uses the besteffort
package.  The backups hooks goroutine handling was cleaned up as part of
besteffort refactoring.

Release note: None
Part of: cockroachdb#152677
@andrew-r-thomas andrew-r-thomas force-pushed the besteffort-backup-telemetry-refactoring branch from b3d7fde to aa27876 Compare January 22, 2026 00:32
@andrew-r-thomas
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 22, 2026

@craig craig bot merged commit dd88e51 into cockroachdb:master Jan 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants