-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
97589: backupccl: send chunks with fail scatters to random node in generative ssp r=rhu713 a=rhu713 For chunks that have failed to scatter, this patch routes the chunk to a random node instead of the current node. This is necessary as prior to the generative version, split and scatter processors were on every node, thus there was no imbalance introduced from routing chunks that have failed to scatter to the current node. The new generative split and scatter processor is only on 1 node, and thus would cause the same node to process all chunks that have failed to scatter. Addresses run 6 and 9 of #99206 Release note: None 98978: upgrades: add a missing unit test r=adityamaru a=knz My previous change in this area failed to add the unit test. Epic: CRDB-23559 Release note: None Co-authored-by: Rui Hu <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]>
- Loading branch information
Showing
4 changed files
with
248 additions
and
10 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
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,63 @@ | ||
// Copyright 2023 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 upgrades_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/base" | ||
"github.com/cockroachdb/cockroach/pkg/clusterversion" | ||
"github.com/cockroachdb/cockroach/pkg/server" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/skip" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster" | ||
"github.com/cockroachdb/cockroach/pkg/upgrade/upgrades" | ||
"github.com/cockroachdb/cockroach/pkg/util/leaktest" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTaskTablesMigration(t *testing.T) { | ||
skip.UnderStressRace(t) | ||
defer leaktest.AfterTest(t)() | ||
ctx := context.Background() | ||
|
||
clusterArgs := base.TestClusterArgs{ | ||
ServerArgs: base.TestServerArgs{ | ||
Knobs: base.TestingKnobs{ | ||
Server: &server.TestingKnobs{ | ||
DisableAutomaticVersionUpgrade: make(chan struct{}), | ||
BinaryVersionOverride: clusterversion.ByKey( | ||
clusterversion.V23_1_TaskSystemTables - 1), | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
tc := testcluster.StartTestCluster(t, 1, clusterArgs) | ||
|
||
defer tc.Stopper().Stop(ctx) | ||
db := tc.ServerConn(0) | ||
defer db.Close() | ||
|
||
upgrades.Upgrade( | ||
t, | ||
db, | ||
clusterversion.V23_1_TaskSystemTables, | ||
nil, | ||
false, | ||
) | ||
|
||
_, err := db.Exec("SELECT * FROM system.task_payloads") | ||
assert.NoError(t, err, "system.task_payloads exists") | ||
|
||
_, err = db.Exec("SELECT * FROM system.tenant_tasks") | ||
assert.NoError(t, err, "system.tenant_tasks exists") | ||
} |