From 367730e311634466ef3a8f7568213d75ee675cbb Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Thu, 9 Sep 2021 11:02:51 -0400 Subject: [PATCH 1/3] colexec: adjust the eager cancellation in parallel unordered sync a bit This commit adjusts the logic for swallowing errors in the parallel unordered synchronizer because of the eager cancellation when the synchronizer transitions into the draining state to swallow all errors coming from an input if the input's context has been canceled by the synchronizer. Release note: None Release justification: update to the new functionality. --- pkg/sql/colexec/BUILD.bazel | 1 - .../parallel_unordered_synchronizer.go | 36 ++++++------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/pkg/sql/colexec/BUILD.bazel b/pkg/sql/colexec/BUILD.bazel index 74c128b876a0..32632d8151f4 100644 --- a/pkg/sql/colexec/BUILD.bazel +++ b/pkg/sql/colexec/BUILD.bazel @@ -71,7 +71,6 @@ go_library( "//pkg/sql/sqltelemetry", # keep "//pkg/sql/types", "//pkg/util", - "//pkg/util/cancelchecker", "//pkg/util/duration", # keep "//pkg/util/encoding", # keep "//pkg/util/humanizeutil", diff --git a/pkg/sql/colexec/parallel_unordered_synchronizer.go b/pkg/sql/colexec/parallel_unordered_synchronizer.go index 8cfb01c1d7b7..59c375b10754 100644 --- a/pkg/sql/colexec/parallel_unordered_synchronizer.go +++ b/pkg/sql/colexec/parallel_unordered_synchronizer.go @@ -22,8 +22,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/colexecop" "github.com/cockroachdb/cockroach/pkg/sql/execinfra" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" - "github.com/cockroachdb/cockroach/pkg/util" - "github.com/cockroachdb/cockroach/pkg/util/cancelchecker" "github.com/cockroachdb/cockroach/pkg/util/tracing" "github.com/cockroachdb/errors" ) @@ -249,30 +247,16 @@ func (s *ParallelUnorderedSynchronizer) init() { switch state { case parallelUnorderedSynchronizerStateRunning: if err := colexecerror.CatchVectorizedRuntimeError(s.nextBatch[inputIdx]); err != nil { - if s.Ctx.Err() == nil && s.cancelLocalInput[inputIdx] != nil { - if errors.Is(err, context.Canceled) || errors.Is(err, cancelchecker.QueryCanceledError) { - // The input context has been canceled, yet the - // main context of the synchronizer has not. - // This indicates that the synchronizer has - // transitioned into draining state and wanted - // this goroutine to stop whatever it was doing. - // Therefore, we swallow the error and proceed - // to draining. - // - // Note that we need the second part of the - // conditional in case the context cancellation - // was observed by the CancelChecker and was - // propagated as a query canceled error. - if util.CrdbTestBuild { - if s.getState() != parallelUnorderedSynchronizerStateDraining { - colexecerror.InternalError(errors.AssertionFailedf( - "unexpectedly the input context is canceled, the main " + - "context is not, and not in the draining state", - )) - } - } - continue - } + if s.getState() == parallelUnorderedSynchronizerStateDraining && s.Ctx.Err() == nil && s.cancelLocalInput[inputIdx] != nil { + // The synchronizer has just transitioned into the + // draining state and eagerly canceled work of this + // input. That cancellation is likely to manifest + // itself as the context.Canceled error, but it + // could be another error too; in any case, we will + // swallow the error because the user of the + // synchronizer is only interested in the metadata + // at this point. + continue } sendErr(err) return From a04263c0a80361122d2d5a810be01ea3e5acb5d3 Mon Sep 17 00:00:00 2001 From: Cameron Nunez Date: Thu, 9 Sep 2021 15:56:38 -0400 Subject: [PATCH 2/3] log: fix lack of logging tags being improperly represented in the docs Release note: none --- docs/generated/logformats.md | 12 ++++++------ pkg/util/log/format_crdb_v2.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/generated/logformats.md b/docs/generated/logformats.md index eb197a4e3087..2c265d6f93fa 100644 --- a/docs/generated/logformats.md +++ b/docs/generated/logformats.md @@ -255,7 +255,7 @@ reliably that no counter was present. Example single-line unstructured entry: ~~~ -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 started with engine type ‹2› +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 started with engine type ‹2› ~~~ Example multi-line unstructured entry: @@ -268,19 +268,19 @@ I210116 21:49:17.083093 14 1@cli/start.go:690 ⋮ [-] 40 +CockroachDB node start Example structured entry: ~~~ -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 ={"Timestamp":1610833757080706620,"EventType":"node_restart"} +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 ={"Timestamp":1610833757080706620,"EventType":"node_restart"} ~~~ Example long entries broken up into multiple lines: ~~~ -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.... -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.... +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ~~~ ~~~ -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 ={"Timestamp":1610833757080706620,"EventTy... -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 |pe":"node_restart"} +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 ={"Timestamp":1610833757080706620,"EventTy... +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 |pe":"node_restart"} ~~~ ### Backward-compatibility notes diff --git a/pkg/util/log/format_crdb_v2.go b/pkg/util/log/format_crdb_v2.go index db49cd0a5ac8..f12bcdb991bc 100644 --- a/pkg/util/log/format_crdb_v2.go +++ b/pkg/util/log/format_crdb_v2.go @@ -115,7 +115,7 @@ reliably that no counter was present. Example single-line unstructured entry: ~~~ -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 started with engine type ‹2› +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 started with engine type ‹2› ~~~ Example multi-line unstructured entry: @@ -128,19 +128,19 @@ I210116 21:49:17.083093 14 1@cli/start.go:690 ⋮ [-] 40 +CockroachDB node start Example structured entry: ~~~ -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 ={"Timestamp":1610833757080706620,"EventType":"node_restart"} +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 ={"Timestamp":1610833757080706620,"EventType":"node_restart"} ~~~ Example long entries broken up into multiple lines: ~~~ -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.... -I210116 21:49:17.073282 14 server/node.go:464 ⋮ [] 23 |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.... +I210116 21:49:17.073282 14 server/node.go:464 ⋮ [-] 23 |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ~~~ ~~~ -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 ={"Timestamp":1610833757080706620,"EventTy... -I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [] 32 |pe":"node_restart"} +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 ={"Timestamp":1610833757080706620,"EventTy... +I210116 21:49:17.080713 14 1@util/log/event_log.go:32 ⋮ [-] 32 |pe":"node_restart"} ~~~ ### Backward-compatibility notes From abbf8030ce57a57590f715f207a9e8fa1871a15e Mon Sep 17 00:00:00 2001 From: Andrii Vorobiov Date: Thu, 9 Sep 2021 22:30:33 +0300 Subject: [PATCH 3/3] ui: increment cluster-ui version to 22.1 After the release branch for 21.2 version is cut, the version of `cluster-ui` NPM package is changed to next major version 22.1.x on master branch Release note: none Release justification: non-production code changes --- pkg/ui/workspaces/cluster-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ui/workspaces/cluster-ui/package.json b/pkg/ui/workspaces/cluster-ui/package.json index ddfd70401cc9..f5a46ec6b5b8 100644 --- a/pkg/ui/workspaces/cluster-ui/package.json +++ b/pkg/ui/workspaces/cluster-ui/package.json @@ -1,6 +1,6 @@ { "name": "@cockroachlabs/cluster-ui", - "version": "21.2.0-prerelease-4", + "version": "22.1.0-prerelease-1", "description": "Cluster UI is a library of large features shared between CockroachDB and CockroachCloud", "repository": { "type": "git",