Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
56694: packer: tweak timeouts r=jlinder a=otan

Tweak timeouts for slower connections and the abundance of more tests.

Release note: None

56783: colexec: make hash joiner more dynamic r=yuzefovich a=yuzefovich

**colexec: clean up the hash joiner a bit**

When we have unmatched tuples from the left in case of left/full outer
hash joins, we still copy the whole vectors according to `buildIdx`
selection vector from the right side and then set nulls only for the
tuples that didn't have a match. Such approach is a lot more performant
then if we were to check for each tuple whether it had a match and copy
only the matched ones. This works ok since we assume that `buildIdx`
value for unmatched tuples is left as 0 which we didn't explicitly do in
distinctCollect variation. Note that it still worked correctly in all
cases (both in in-memory hash joiner and external hash joiner) because
we're zeroing out the slice when resetting (which is important for the
external hash joiner).

Given the observation that we're now always setting the correct values
in `buildIdx`, `probeIdx`, `probeRowUnmatched`, this commit additionally
removes zeroing out of those slices during resetting.

Release note: None

**colexec: make hash joiner more dynamic**

This commit refactors the hash joiner slightly in order to avoid
allocating slices with big fixed size which makes the algorithm more
dynamic.

Release note: None


56837: sql: cleanup SURVIVE ... FAILURE syntax r=ajstorm a=otan

sql: remove SURVIVE DEFAULT; rename Survive to SurvivalGoal

We still need a concept of "default" for tree.SurviveDefault so that we
do not display it syntactically, but the value will be transformed
before it is persisted.

Release note: None

sql: rename SURVIVE AVAILABILITY ZONE FAILURE to SURVIVE ZONE FAILURE

Release note (sql change): SURVIVE AVAILABILITY ZONE FAILURE is now
SURVIVE ZONE FAILURE.



56854: backupccl: skip TestRestoreMidSchemaChange under race r=adityamaru a=pbardea

This test is intended to verify that the particular set of backups taken
of descriptors during a schema change. Not much is gained running these
under race, but they are very slow so they should be skipped.

Fixes #56584.

Release note: None

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Paul Bardea <pbardea@gmail.com>
  • Loading branch information
4 people committed Nov 18, 2020
5 parents e909f24 + 503ef79 + d9e718e + 37e64de + 58a085f commit 4897231
Show file tree
Hide file tree
Showing 22 changed files with 262 additions and 212 deletions.
3 changes: 2 additions & 1 deletion build/packer/teamcity-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"image_description": "{{user `image_id`}}",
"ssh_username": "packer",
"disk_size": 256,
"disk_type": "pd-ssd"
"disk_type": "pd-ssd",
"state_timeout": "15m"
}],

"provisioners": [{
Expand Down
2 changes: 1 addition & 1 deletion build/packer/teamcity-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ do
git clean -dxf
git checkout "$branch"
COCKROACH_BUILDER_CCACHE=1 build/builder.sh make test testrace TESTS=-
COCKROACH_BUILDER_CCACHE=1 build/builder.sh make test testrace TESTTIMEOUT=45m TESTS=-
# TODO(benesch): store the acceptanceversion somewhere more accessible.
docker pull $(git grep cockroachdb/acceptance -- '*.go' | sed -E 's/.*"([^"]*).*"/\1/') || true
done
Expand Down
4 changes: 1 addition & 3 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@ unreserved_keyword ::=
| 'AT'
| 'ATTRIBUTE'
| 'AUTOMATIC'
| 'AVAILABILITY'
| 'BACKUP'
| 'BACKUPS'
| 'BEFORE'
Expand Down Expand Up @@ -2143,8 +2142,7 @@ region_name ::=

survive_clause ::=
'SURVIVE' 'REGION' 'FAILURE'
| 'SURVIVE' 'AVAILABILITY' 'ZONE' 'FAILURE'
| 'SURVIVE' 'DEFAULT'
| 'SURVIVE' 'ZONE' 'FAILURE'

role_option ::=
'CREATEROLE'
Expand Down
4 changes: 4 additions & 0 deletions pkg/ccl/backupccl/restore_mid_schema_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/jobs"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
Expand Down Expand Up @@ -52,6 +53,9 @@ import (
func TestRestoreMidSchemaChange(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.UnderRaceWithIssue(t, 56584)

const (
testdataBase = "testdata/restore_mid_schema_change"
exportDirs = testdataBase + "/exports"
Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/alter_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func (p *planner) AlterDatabaseDropRegion(
return nil, unimplemented.New("alter database drop region", "implementation pending")
}

// AlterDatabaseSurvive transforms a tree.AlterDatabaseSurvive into a plan node.
func (p *planner) AlterDatabaseSurvive(
ctx context.Context, n *tree.AlterDatabaseSurvive,
// AlterDatabaseSurvivalGoal transforms a tree.AlterDatabaseSurvivalGoal into a plan node.
func (p *planner) AlterDatabaseSurvivalGoal(
ctx context.Context, n *tree.AlterDatabaseSurvivalGoal,
) (planNode, error) {
return nil, unimplemented.New("alter database survive", "implementation pending")
}
18 changes: 18 additions & 0 deletions pkg/sql/catalog/descpb/join_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@ func (j JoinType) IsEmptyOutputWhenRightIsEmpty() bool {
return false
}
}

// IsLeftOuterOrFullOuter returns whether j is either LEFT OUTER or FULL OUTER
// join type.
func (j JoinType) IsLeftOuterOrFullOuter() bool {
return j == LeftOuterJoin || j == FullOuterJoin
}

// IsLeftAntiOrExceptAll returns whether j is either LEFT ANTI or EXCEPT ALL
// join type.
func (j JoinType) IsLeftAntiOrExceptAll() bool {
return j == LeftAntiJoin || j == ExceptAllJoin
}

// IsRightSemiOrRightAnti returns whether j is either RIGHT SEMI or RIGHT ANTI
// join type.
func (j JoinType) IsRightSemiOrRightAnti() bool {
return j == RightSemiJoin || j == RightAntiJoin
}
5 changes: 1 addition & 4 deletions pkg/sql/colexec/colbuilder/execplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,17 +860,14 @@ func NewColOperator(
// joiner, in order to handle NULL values correctly, needs to think
// that an empty set of equality columns doesn't form a key.
rightEqColsAreKey := core.HashJoiner.RightEqColumnsAreKey && len(core.HashJoiner.RightEqColumns) > 0
hjSpec, err := colexec.MakeHashJoinerSpec(
hjSpec := colexec.MakeHashJoinerSpec(
core.HashJoiner.Type,
core.HashJoiner.LeftEqColumns,
core.HashJoiner.RightEqColumns,
leftTypes,
rightTypes,
rightEqColsAreKey,
)
if err != nil {
return r, err
}

inMemoryHashJoiner := colexec.NewHashJoiner(
colmem.NewAllocator(ctx, hashJoinerMemAccount, factory),
Expand Down
91 changes: 49 additions & 42 deletions pkg/sql/colexec/hashjoiner.eg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4897231

Please sign in to comment.