forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…db#57265 cockroachdb#57278 cockroachdb#57313 cockroachdb#57316 cockroachdb#57326 56815: jepsen: ignore some install errors r=andreimatei a=andreimatei Two failures. Seem to have been transient. ``` | Could not transfer artifact org.clojure:clojure:jar:1.9.0 from/to central (https://repo1.maven.org/maven2/): GET request of: org/clojure/clojure/1.9.0/clojure-1.9.0.jar from central failed | Could not find artifact org.clojure:clojure:jar:1.9.0 in clojars (https://repo.clojars.org/) | This could be due to a typo in :dependencies, file system permissions, or network issues. | If you are behind a proxy, try setting the 'http_proxy' environment variable. ``` ``` | Failed to read artifact descriptor for commons-codec:commons-codec:jar:1.6 | This could be due to a typo in :dependencies, file system permissions, or network issues. ``` Fixes cockroachdb#56695 Fixes cockroachdb#56645 Release note: None 57035: colflow: add sync protection to latency getter map r=asubiotto a=cathymw This commit adds a mutex lock to LatencyGetter, ensuring that concurrent writes to the latencyMap do not occur. Closes: cockroachdb#56997 Closes: cockroachdb#56360 Closes: cockroachdb#56278 Closes: cockroachdb#56275 Release note: None. 57262: roachtest: remove testDollarQuotes from v21.1 blocklist r=rafiss a=otan These seem to pass now, have not digged deep into why but passing is always good news. Refs cockroachdb#57168 Release note: None 57265: pgwire: lazily populate second timezone offset r=rafiss a=otan Looks like cockroachdb#55071 was too greedy -- looks like (at the very least) pgjdbc expects the second offset to only be displayed if there is a second offset. It's easy to do, so I have done so. Fixed TimeTZ along the way. Refs cockroachdb#57168 Release note (bug fix): Second timezone offsets for TimeTZ now correctly display over the postgres wire protocol - these were previously omitted. Release note (bug fix): Second timezone offsets are only displayed in the postgres wire protocol for TimestampTZ values. In an earlier patch for v21.1, this would always display. 57278: sql: add SHOW SURVIVAL GOAL FROM DATABASE r=ajstorm a=otan two commits in here, one is a minor fix up i thought might as well go in with this one. ---- delegate: add database name to SHOW REGIONS FROM DATABASE This seems to match behaviour I've seen from other places, e.g. SHOW ZONE CONFIGURATION. Release note (sql change): The database name is now displayed in `SHOW REGIONS FROM DATABASE`. sql: add SHOW SURVIVAL GOAL FROM DATABASE Release note (sql change): Add `SHOW SURVIVAL GOAL FROM DATABASE [database]`, which shows the survival goal for a multi-region database. 57313: licenses: Update CCL reference to Apache license r=bdarnell a=bdarnell CCL.txt contains an outdated reference to the Apache license. This edit brings it up to date with the text on https://www.cockroachlabs.com/cockroachdb-community-license/ Release note: None 57316: sql: categorize undefined column error when adding unique constraints r=ajwerner a=jayshrivastava Previously, adding a unique constraint to a table on one or more columns that do not exist would cause uncategorized error. Now, the error is categorized as pgcode.UndefinedColumn. Closes: cockroachdb#57314 Release note (sql change): A pgcode.UndefinedColumn will now be returned when adding a unique constraint to one or more undefined columns. 57326: authors: add kevinkokomani to authors r=otan a=kevinkokomani Release note: None Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Cathy <[email protected]> Co-authored-by: Oliver Tan <[email protected]> Co-authored-by: Ben Darnell <[email protected]> Co-authored-by: Jayant Shrivastava <[email protected]> Co-authored-by: Kevin Kokomani <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,237 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,7 @@ Kenji Kaneda <[email protected]> <[email protected]> | |
Kenjiro Nakayama <[email protected]> | ||
Kenneth Liu <[email protected]> | ||
Kevin Guan <[email protected]> | ||
Kevin Kokomani <[email protected]> <[email protected]> | ||
kiran <[email protected]> | ||
lanzao <[email protected]> | ||
Lasantha Pambagoda <[email protected]> | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,75 @@ | ||
// Copyright 2020 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 serverpb | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
"time" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/roachpb" | ||
"github.com/cockroachdb/cockroach/pkg/util/timeutil" | ||
) | ||
|
||
func TestLatencyGetter_GetLatency(t *testing.T) { | ||
type fields struct { | ||
lastUpdatedTime time.Time | ||
latencyMap map[roachpb.NodeID]map[roachpb.NodeID]int64 | ||
} | ||
type args struct { | ||
ctx context.Context | ||
originNodeID roachpb.NodeID | ||
targetNodeID roachpb.NodeID | ||
} | ||
|
||
latencyMap := map[roachpb.NodeID]map[roachpb.NodeID]int64{ | ||
1: {2: 5}, | ||
2: {1: 3}, | ||
} | ||
|
||
tests := []struct { | ||
name string | ||
fields fields | ||
args args | ||
expectedLatency int64 | ||
}{ | ||
{ | ||
name: "GetLatencyWithoutUpdate", | ||
fields: fields{ | ||
lastUpdatedTime: timeutil.Now().Add(time.Hour), | ||
latencyMap: latencyMap, | ||
}, | ||
args: args{ctx: context.Background(), originNodeID: 1, targetNodeID: 2}, | ||
expectedLatency: 5, | ||
}, | ||
{ | ||
name: "UpdateLatencies", | ||
fields: fields{ | ||
lastUpdatedTime: timeutil.Now().Add(time.Hour * -1), | ||
latencyMap: latencyMap, | ||
}, | ||
args: args{ctx: context.Background(), originNodeID: 1, targetNodeID: 2}, | ||
// expectedLatency is 0 for this test because when the NodesStatusServer can't be accessed, | ||
// a latency of 0 is returned so that it isn't displayed on EXPLAIN ANALYZE diagrams. | ||
expectedLatency: 0, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
lg := &LatencyGetter{} | ||
lg.mu.lastUpdatedTime = tt.fields.lastUpdatedTime | ||
lg.mu.latencyMap = tt.fields.latencyMap | ||
if got := lg.GetLatency(tt.args.ctx, tt.args.originNodeID, tt.args.targetNodeID); got != tt.expectedLatency { | ||
t.Errorf("GetLatency() = %v, want %v", got, tt.expectedLatency) | ||
} | ||
}) | ||
} | ||
} |
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
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,37 @@ | ||
// Copyright 2020 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 delegate | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/sql/lex" | ||
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree" | ||
"github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry" | ||
) | ||
|
||
// delegateShowRanges implements the SHOW REGIONS statement. | ||
func (d *delegator) delegateShowSurvivalGoal(n *tree.ShowSurvivalGoal) (tree.Statement, error) { | ||
sqltelemetry.IncrementShowCounter(sqltelemetry.SurvivalGoal) | ||
dbName := string(n.DatabaseName) | ||
if dbName == "" { | ||
dbName = d.evalCtx.SessionData.Database | ||
} | ||
query := fmt.Sprintf( | ||
`SELECT | ||
name AS "database", | ||
survival_goal | ||
FROM crdb_internal.databases | ||
WHERE name = %s`, | ||
lex.EscapeSQLString(dbName), | ||
) | ||
return parse(query) | ||
} |
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
Oops, something went wrong.