-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
47053: sql: add telemetry for statement diagnostics r=RaduBerinde a=RaduBerinde Add two telemetry counters for statement diagnostics - one when triggered via the UI, one for EXPLAIN ANALYZE (DEBUG). Release note: None 47056: workload/schemachange: create new table 90% of the time r=spaskob a=spaskob Release note (bug fix): we were using an existing table name 100% of the time when creating a new table which resulted in no tables created. 47063: retry: fix retry.WithMaxAttempt to deal with opt.Closer properly r=knz a=otan In `beac4a53e0e2e2236eb5957f67abc1bf476ad1b6`, we introduced stopper.ShouldQuiesce() to the retry.Closer so that server shutdowns also shut down in-process retries to the temp schema cleaner. However, when stopper.ShouldQuiesce() is called, the error that gets wrapped in `errors.Wrap` is nil (as ctx.Err() is nil), and as such we return with no error set. This causes potentially bugs afterwards as users of the functions expected errors when this happens and not to continue silently. This PR bridges that gap by always wrapping an error around cases where WithMaxAttempt is aborted by a context attempt. Resolves #47057. Release note: None. Co-authored-by: Radu Berinde <[email protected]> Co-authored-by: Spas Bojanov <[email protected]> Co-authored-by: Oliver Tan <[email protected]>
- Loading branch information
Showing
7 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package sqltelemetry | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/server/telemetry" | ||
|
||
// StatementDiagnosticsCollectedCounter is to be incremented whenever a query is | ||
// run with diagnostic collection (as a result of a user request through the | ||
// UI). This does not include diagnostics collected through | ||
// EXPLAIN ANALYZE (DEBUG), which has a separate counter. | ||
// distributed across multiple nodes. | ||
var StatementDiagnosticsCollectedCounter = telemetry.GetCounterOnce("sql.diagnostics.collected") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters