From 714ae9d0f0b7d5ceb1e24a40ac2e89a6d007fc35 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:55:43 +0100 Subject: [PATCH 01/12] TxThrottler only throttles if current lag is above threshold. This the lag caches in MaxReplicationLagModule Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/throttler/throttler.go | 23 +++++++++++++++++++ .../tabletserver/txthrottler/tx_throttler.go | 15 +++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/go/vt/throttler/throttler.go b/go/vt/throttler/throttler.go index 206891e311e..abc6d760729 100644 --- a/go/vt/throttler/throttler.go +++ b/go/vt/throttler/throttler.go @@ -32,6 +32,7 @@ import ( "math" "sync" "time" + "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/log" @@ -224,6 +225,28 @@ func (t *Throttler) Throttle(threadID int) time.Duration { return t.threadThrottlers[threadID].throttle(t.nowFunc()) } +// LastMaxLagNotIgnoredForTabletType returns the max of all the last replication lag values seen across all tablets of +// the provided type, excluding ignored tablets. +func (t *Throttler) LastMaxLagNotIgnoredForTabletType(tabletType topodata.TabletType) uint32 { + cache := t.maxReplicationLagModule.lagCacheByType(tabletType) + + var maxLag uint32 + cacheEntries := cache.entries + + for key, _ := range cacheEntries { + if cache.isIgnored(key) { + continue + } + + lag := cache.latest(key).Stats.ReplicationLagSeconds + if lag > maxLag { + maxLag = lag + } + } + + return maxLag +} + // ThreadFinished marks threadID as finished and redistributes the thread's // rate allotment across the other threads. // After ThreadFinished() is called, Throttle() must not be called anymore. diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 9f2f369ffd9..6841fa0a1b4 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -86,6 +86,7 @@ type ThrottlerInterface interface { GetConfiguration() *throttlerdatapb.Configuration UpdateConfiguration(configuration *throttlerdatapb.Configuration, copyZeroValues bool) error ResetConfiguration() + LastMaxLagNotIgnoredForTabletType(tabletType topodatapb.TabletType) uint32 } // TopologyWatcherInterface defines the public interface that is implemented by @@ -359,7 +360,19 @@ func (ts *txThrottlerStateImpl) throttle() bool { // Serialize calls to ts.throttle.Throttle() ts.throttleMu.Lock() defer ts.throttleMu.Unlock() - return ts.throttler.Throttle(0 /* threadId */) > 0 + + var maxLag uint32 + + for _, tabletType := range ts.config.tabletTypes { + maxLagPerTabletType := ts.throttler.LastMaxLagNotIgnoredForTabletType(tabletType) + if maxLagPerTabletType > maxLag { + maxLag = maxLagPerTabletType + } + } + + return ts.throttler.Throttle(0 /* threadId */) > 0 && + int64(maxLag) > ts.config.throttlerConfig.TargetReplicationLagSec + } func (ts *txThrottlerStateImpl) deallocateResources() { From 51daff1e862132b7836c595c171f3b9996c02b96 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:42:31 +0100 Subject: [PATCH 02/12] Fix tests Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- .../txthrottler/mock_throttler_test.go | 57 ++++++++++------ .../txthrottler/tx_throttler_test.go | 65 +++++++++++++++---- 2 files changed, 87 insertions(+), 35 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go index a3da535037e..75daf37c5a0 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: vitess.io/vitess/go/vt/vttablet/tabletserver/txthrottler (interfaces: ThrottlerInterface) +// Source: ./go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go // Package txthrottler is a generated GoMock package. package txthrottler @@ -12,6 +12,7 @@ import ( discovery "vitess.io/vitess/go/vt/discovery" throttlerdata "vitess.io/vitess/go/vt/proto/throttlerdata" + topodata "vitess.io/vitess/go/vt/proto/topodata" ) // MockThrottlerInterface is a mock of ThrottlerInterface interface. @@ -63,6 +64,20 @@ func (mr *MockThrottlerInterfaceMockRecorder) GetConfiguration() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfiguration", reflect.TypeOf((*MockThrottlerInterface)(nil).GetConfiguration)) } +// LastMaxLagNotIgnoredForTabletType mocks base method. +func (m *MockThrottlerInterface) LastMaxLagNotIgnoredForTabletType(tabletType topodata.TabletType) uint32 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastMaxLagNotIgnoredForTabletType", tabletType) + ret0, _ := ret[0].(uint32) + return ret0 +} + +// LastMaxLagNotIgnoredForTabletType indicates an expected call of LastMaxLagNotIgnoredForTabletType. +func (mr *MockThrottlerInterfaceMockRecorder) LastMaxLagNotIgnoredForTabletType(tabletType interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMaxLagNotIgnoredForTabletType", reflect.TypeOf((*MockThrottlerInterface)(nil).LastMaxLagNotIgnoredForTabletType), tabletType) +} + // MaxRate mocks base method. func (m *MockThrottlerInterface) MaxRate() int64 { m.ctrl.T.Helper() @@ -78,15 +93,15 @@ func (mr *MockThrottlerInterfaceMockRecorder) MaxRate() *gomock.Call { } // RecordReplicationLag mocks base method. -func (m *MockThrottlerInterface) RecordReplicationLag(arg0 time.Time, arg1 *discovery.LegacyTabletStats) { +func (m *MockThrottlerInterface) RecordReplicationLag(time time.Time, ts *discovery.LegacyTabletStats) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RecordReplicationLag", arg0, arg1) + m.ctrl.Call(m, "RecordReplicationLag", time, ts) } // RecordReplicationLag indicates an expected call of RecordReplicationLag. -func (mr *MockThrottlerInterfaceMockRecorder) RecordReplicationLag(arg0, arg1 any) *gomock.Call { +func (mr *MockThrottlerInterfaceMockRecorder) RecordReplicationLag(time, ts interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordReplicationLag", reflect.TypeOf((*MockThrottlerInterface)(nil).RecordReplicationLag), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordReplicationLag", reflect.TypeOf((*MockThrottlerInterface)(nil).RecordReplicationLag), time, ts) } // ResetConfiguration mocks base method. @@ -102,53 +117,53 @@ func (mr *MockThrottlerInterfaceMockRecorder) ResetConfiguration() *gomock.Call } // SetMaxRate mocks base method. -func (m *MockThrottlerInterface) SetMaxRate(arg0 int64) { +func (m *MockThrottlerInterface) SetMaxRate(rate int64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetMaxRate", arg0) + m.ctrl.Call(m, "SetMaxRate", rate) } // SetMaxRate indicates an expected call of SetMaxRate. -func (mr *MockThrottlerInterfaceMockRecorder) SetMaxRate(arg0 any) *gomock.Call { +func (mr *MockThrottlerInterfaceMockRecorder) SetMaxRate(rate interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetMaxRate", reflect.TypeOf((*MockThrottlerInterface)(nil).SetMaxRate), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetMaxRate", reflect.TypeOf((*MockThrottlerInterface)(nil).SetMaxRate), rate) } // ThreadFinished mocks base method. -func (m *MockThrottlerInterface) ThreadFinished(arg0 int) { +func (m *MockThrottlerInterface) ThreadFinished(threadID int) { m.ctrl.T.Helper() - m.ctrl.Call(m, "ThreadFinished", arg0) + m.ctrl.Call(m, "ThreadFinished", threadID) } // ThreadFinished indicates an expected call of ThreadFinished. -func (mr *MockThrottlerInterfaceMockRecorder) ThreadFinished(arg0 any) *gomock.Call { +func (mr *MockThrottlerInterfaceMockRecorder) ThreadFinished(threadID interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ThreadFinished", reflect.TypeOf((*MockThrottlerInterface)(nil).ThreadFinished), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ThreadFinished", reflect.TypeOf((*MockThrottlerInterface)(nil).ThreadFinished), threadID) } // Throttle mocks base method. -func (m *MockThrottlerInterface) Throttle(arg0 int) time.Duration { +func (m *MockThrottlerInterface) Throttle(threadID int) time.Duration { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Throttle", arg0) + ret := m.ctrl.Call(m, "Throttle", threadID) ret0, _ := ret[0].(time.Duration) return ret0 } // Throttle indicates an expected call of Throttle. -func (mr *MockThrottlerInterfaceMockRecorder) Throttle(arg0 any) *gomock.Call { +func (mr *MockThrottlerInterfaceMockRecorder) Throttle(threadID interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Throttle", reflect.TypeOf((*MockThrottlerInterface)(nil).Throttle), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Throttle", reflect.TypeOf((*MockThrottlerInterface)(nil).Throttle), threadID) } // UpdateConfiguration mocks base method. -func (m *MockThrottlerInterface) UpdateConfiguration(arg0 *throttlerdata.Configuration, arg1 bool) error { +func (m *MockThrottlerInterface) UpdateConfiguration(configuration *throttlerdata.Configuration, copyZeroValues bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateConfiguration", arg0, arg1) + ret := m.ctrl.Call(m, "UpdateConfiguration", configuration, copyZeroValues) ret0, _ := ret[0].(error) return ret0 } // UpdateConfiguration indicates an expected call of UpdateConfiguration. -func (mr *MockThrottlerInterfaceMockRecorder) UpdateConfiguration(arg0, arg1 any) *gomock.Call { +func (mr *MockThrottlerInterfaceMockRecorder) UpdateConfiguration(configuration, copyZeroValues interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConfiguration", reflect.TypeOf((*MockThrottlerInterface)(nil).UpdateConfiguration), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConfiguration", reflect.TypeOf((*MockThrottlerInterface)(nil).UpdateConfiguration), configuration, copyZeroValues) } diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index 7b9e4bc98bd..65ef64614d1 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -89,27 +89,58 @@ func TestEnabledThrottler(t *testing.T) { return mockThrottler, nil } - call0 := mockThrottler.EXPECT().UpdateConfiguration(gomock.Any(), true /* copyZeroValues */) - call1 := mockThrottler.EXPECT().Throttle(0) - call1.Return(0 * time.Second) + var calls []*gomock.Call + + call := mockThrottler.EXPECT().UpdateConfiguration(gomock.Any(), true /* copyZeroValues */) + calls = append(calls, call) + + call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) + call.Return(uint32(20)) + calls = append(calls, call) + + call = mockThrottler.EXPECT().Throttle(0) + call.Return(0 * time.Second) + calls = append(calls, call) + tabletStats := &discovery.LegacyTabletStats{ Target: &querypb.Target{ TabletType: topodatapb.TabletType_REPLICA, }, } - call2 := mockThrottler.EXPECT().RecordReplicationLag(gomock.Any(), tabletStats) - call3 := mockThrottler.EXPECT().Throttle(0) - call3.Return(1 * time.Second) - call4 := mockThrottler.EXPECT().Throttle(0) - call4.Return(1 * time.Second) - calllast := mockThrottler.EXPECT().Close() + call = mockThrottler.EXPECT().RecordReplicationLag(gomock.Any(), tabletStats) + calls = append(calls, call) + + call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) + call.Return(uint32(20)) + calls = append(calls, call) + + call = mockThrottler.EXPECT().Throttle(0) + call.Return(1 * time.Second) + calls = append(calls, call) + + call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) + call.Return(uint32(20)) + calls = append(calls, call) + + call = mockThrottler.EXPECT().Throttle(0) + call.Return(1 * time.Second) + calls = append(calls, call) - call1.After(call0) - call2.After(call1) - call3.After(call2) - call4.After(call3) - calllast.After(call4) + call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) + call.Return(uint32(1)) + calls = append(calls, call) + + call = mockThrottler.EXPECT().Throttle(0) + call.Return(1 * time.Second) + calls = append(calls, call) + + call = mockThrottler.EXPECT().Close() + calls = append(calls, call) + + for i := 1; i < len(calls); i++ { + calls[i].After(calls[i-1]) + } config := tabletenv.NewDefaultConfig() config.EnableTxThrottler = true @@ -147,6 +178,12 @@ func TestEnabledThrottler(t *testing.T) { assert.False(t, throttler.Throttle(0, "some-workload")) assert.Equal(t, int64(3), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) + + // This call should not throttle despite priority. Check that's the case and counters agree. + assert.False(t, throttler.Throttle(100, "some-workload")) + assert.Equal(t, int64(4), throttler.requestsTotal.Counts()["some-workload"]) + assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) + throttler.Close() assert.Zero(t, throttler.throttlerRunning.Get()) } From 414b0ecb73ea7a84805a0936f94e6026d6e8d43f Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:51:18 +0100 Subject: [PATCH 03/12] Make linter happy Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/throttler/throttler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/go/vt/throttler/throttler.go b/go/vt/throttler/throttler.go index abc6d760729..fbd3ac8a657 100644 --- a/go/vt/throttler/throttler.go +++ b/go/vt/throttler/throttler.go @@ -32,6 +32,7 @@ import ( "math" "sync" "time" + "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/discovery" From ac47e7fa0d9f0aa46cc29f68c87404cc07d79193 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:01:35 +0100 Subject: [PATCH 04/12] Make linter happy Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/throttler/throttler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/throttler/throttler.go b/go/vt/throttler/throttler.go index fbd3ac8a657..73ad66fe92d 100644 --- a/go/vt/throttler/throttler.go +++ b/go/vt/throttler/throttler.go @@ -234,7 +234,7 @@ func (t *Throttler) LastMaxLagNotIgnoredForTabletType(tabletType topodata.Tablet var maxLag uint32 cacheEntries := cache.entries - for key, _ := range cacheEntries { + for key := range cacheEntries { if cache.isIgnored(key) { continue } From 36088df6c433ea78608bf212873fc214f81544e6 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:42:29 +0100 Subject: [PATCH 05/12] Eduardo.ortega/slack vitess r14.0.5 fix mysql pkgs (#174) * Fix MySQL repo & key Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> * More fix MySQL repo & key Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --------- Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- .github/workflows/cluster_endtoend_12.yml | 4 +- .github/workflows/cluster_endtoend_13.yml | 4 +- .github/workflows/cluster_endtoend_15.yml | 4 +- .github/workflows/cluster_endtoend_18.yml | 4 +- .github/workflows/cluster_endtoend_21.yml | 4 +- .github/workflows/cluster_endtoend_22.yml | 4 +- ...ter_endtoend_ers_prs_newfeatures_heavy.yml | 4 +- .../workflows/cluster_endtoend_mysql57.yml | 2 +- .../cluster_endtoend_mysql_server_vault.yml | 4 +- ...cluster_endtoend_onlineddl_declarative.yml | 4 +- ...endtoend_onlineddl_declarative_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_ghost.yml | 4 +- ...uster_endtoend_onlineddl_ghost_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_revert.yml | 4 +- ...ster_endtoend_onlineddl_revert_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_revertible.yml | 4 +- ..._endtoend_onlineddl_revertible_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_scheduler.yml | 4 +- ...r_endtoend_onlineddl_scheduler_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_singleton.yml | 4 +- ...r_endtoend_onlineddl_singleton_mysql57.yml | 2 +- .../cluster_endtoend_onlineddl_vrepl.yml | 4 +- ...uster_endtoend_onlineddl_vrepl_mysql57.yml | 2 +- ...luster_endtoend_onlineddl_vrepl_stress.yml | 4 +- ...ndtoend_onlineddl_vrepl_stress_mysql57.yml | 2 +- ..._endtoend_onlineddl_vrepl_stress_suite.yml | 4 +- ...d_onlineddl_vrepl_stress_suite_mysql57.yml | 2 +- ...cluster_endtoend_onlineddl_vrepl_suite.yml | 4 +- ...endtoend_onlineddl_vrepl_suite_mysql57.yml | 2 +- .../cluster_endtoend_schemadiff_vrepl.yml | 4 +- ...ster_endtoend_schemadiff_vrepl_mysql57.yml | 2 +- .../cluster_endtoend_tabletmanager_consul.yml | 4 +- ...cluster_endtoend_tabletmanager_tablegc.yml | 4 +- ...endtoend_tabletmanager_tablegc_mysql57.yml | 2 +- ...uster_endtoend_tabletmanager_throttler.yml | 4 +- ..._tabletmanager_throttler_custom_config.yml | 4 +- ...cluster_endtoend_topo_connection_cache.yml | 4 +- .../cluster_endtoend_vreplication_basic.yml | 4 +- ...luster_endtoend_vreplication_cellalias.yml | 4 +- .../cluster_endtoend_vreplication_migrate.yml | 4 +- ...luster_endtoend_vreplication_multicell.yml | 4 +- .../cluster_endtoend_vreplication_v2.yml | 4 +- .../cluster_endtoend_vstream_failover.yml | 4 +- ...r_endtoend_vstream_stoponreshard_false.yml | 4 +- ...er_endtoend_vstream_stoponreshard_true.yml | 4 +- ...dtoend_vstream_with_keyspaces_to_watch.yml | 4 +- .../cluster_endtoend_vtgate_concurrentdml.yml | 4 +- .../cluster_endtoend_vtgate_gen4.yml | 4 +- .../cluster_endtoend_vtgate_general_heavy.yml | 4 +- .../cluster_endtoend_vtgate_godriver.yml | 4 +- .../cluster_endtoend_vtgate_queries.yml | 4 +- ...cluster_endtoend_vtgate_readafterwrite.yml | 4 +- .../cluster_endtoend_vtgate_reservedconn.yml | 4 +- .../cluster_endtoend_vtgate_schema.yml | 4 +- ...cluster_endtoend_vtgate_schema_tracker.yml | 4 +- ...dtoend_vtgate_tablet_healthcheck_cache.yml | 4 +- .../cluster_endtoend_vtgate_topo.yml | 4 +- .../cluster_endtoend_vtgate_topo_consul.yml | 4 +- .../cluster_endtoend_vtgate_topo_etcd.yml | 4 +- .../cluster_endtoend_vtgate_transaction.yml | 4 +- .../cluster_endtoend_vtgate_unsharded.yml | 4 +- .../cluster_endtoend_vtgate_vindex_heavy.yml | 4 +- .../cluster_endtoend_vtgate_vschema.yml | 4 +- .github/workflows/cluster_endtoend_vtorc.yml | 4 +- .../cluster_endtoend_xb_backup_mysql57.yml | 2 +- .../cluster_endtoend_xb_recovery_mysql57.yml | 2 +- .github/workflows/e2e_race.yml | 4 +- .github/workflows/local_example.yml | 4 +- .github/workflows/region_example.yml | 4 +- .github/workflows/unit_test_mysql80.yml | 2 +- .../upgrade_downgrade_test_backups_manual.yml | 4 +- ...grade_test_backups_manual_next_release.yml | 4 +- ...e_downgrade_test_query_serving_queries.yml | 4 +- ...est_query_serving_queries_next_release.yml | 4 +- ...de_downgrade_test_query_serving_schema.yml | 4 +- ...test_query_serving_schema_next_release.yml | 4 +- ...rade_downgrade_test_reparent_new_vtctl.yml | 4 +- ...e_downgrade_test_reparent_new_vttablet.yml | 4 +- ...rade_downgrade_test_reparent_old_vtctl.yml | 4 +- ...e_downgrade_test_reparent_old_vttablet.yml | 4 +- docker/bootstrap/Dockerfile.mysql57 | 2 +- docker/bootstrap/Dockerfile.mysql80 | 2 +- docker/lite/Dockerfile | 59 ++++++++++++++++++- docker/lite/install_dependencies.sh | 2 +- test/templates/cluster_endtoend_test.tpl | 2 +- 85 files changed, 206 insertions(+), 149 deletions(-) mode change 120000 => 100644 docker/lite/Dockerfile diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml index d4eea2f1b75..e34efbdcd34 100644 --- a/.github/workflows/cluster_endtoend_12.yml +++ b/.github/workflows/cluster_endtoend_12.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml index cb5e10c76d9..d25b00e1bbf 100644 --- a/.github/workflows/cluster_endtoend_13.yml +++ b/.github/workflows/cluster_endtoend_13.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml index cdc3653f7a5..f682b01950b 100644 --- a/.github/workflows/cluster_endtoend_15.yml +++ b/.github/workflows/cluster_endtoend_15.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml index 064e0ea2d38..43441c1c815 100644 --- a/.github/workflows/cluster_endtoend_18.yml +++ b/.github/workflows/cluster_endtoend_18.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml index af87478168e..b34b09e7af3 100644 --- a/.github/workflows/cluster_endtoend_21.yml +++ b/.github/workflows/cluster_endtoend_21.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_22.yml b/.github/workflows/cluster_endtoend_22.yml index f1ac351bdb2..a3fb6c31f3c 100644 --- a/.github/workflows/cluster_endtoend_22.yml +++ b/.github/workflows/cluster_endtoend_22.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml index 74bcf4e653a..a05a48c7c1e 100644 --- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml +++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_mysql57.yml b/.github/workflows/cluster_endtoend_mysql57.yml index ff10577027b..eb6869910e2 100644 --- a/.github/workflows/cluster_endtoend_mysql57.yml +++ b/.github/workflows/cluster_endtoend_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml index b17858aafce..e8eb77b4076 100644 --- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml +++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative.yml index a7ce4022b4b..83bad0854a8 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql57.yml index 0f3ae828bf9..709ceb101ec 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_declarative_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml index a9d89742aaa..4138b38a0e8 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml index 42a150c3a3c..19742b21486 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml index aaed74fc0e9..58603b8cdb9 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml index df95a44f638..abd82c7769c 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible.yml index 3e57092eaf4..9593b09c596 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql57.yml index bdc00193a27..78caa1cbdab 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revertible_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml index 62e537af2be..fc7aac862bc 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml index 4327d881e76..511b9ae4d96 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton.yml index bc9224baad2..16ee46d1e3d 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql57.yml index eeafef5e66f..3bc93fc0af8 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_singleton_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml index 01dcb7af0fc..df6444afd3c 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml index 4e4b636fc91..52de28af22c 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml index 5ba6d51d832..509f031f371 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml index 5573cffdd8b..d9d6ef065d4 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml index b41dc2066f8..58a06c14ba3 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml index ee1a505a4fd..f77cf93dd0f 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml index 5c37c1b0ac4..6aa2ebfb717 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml index 7d058b47dbd..ed5c09c0c0a 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml index 8ae7f47dce3..78984c0253b 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml index a2a66a422bc..1903043db9d 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml index fa94e10571c..748b6db54e2 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml index 4d28ee5cef7..1fd310ad594 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml index 017e10cbcc9..5e7c4d3e797 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml @@ -84,7 +84,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml index ab8c9309869..fc246b0c44c 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml index 25e7b79dba8..f9eee0ff8db 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml index e288469f332..ffd97ca69a5 100644 --- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml +++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml index c6504867ab6..e75a517e4cc 100644 --- a/.github/workflows/cluster_endtoend_vreplication_basic.yml +++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml index a2c9dfc6cfb..ee866327018 100644 --- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml +++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vreplication_migrate.yml b/.github/workflows/cluster_endtoend_vreplication_migrate.yml index 969f15c1ea6..4ae1e3b9ade 100644 --- a/.github/workflows/cluster_endtoend_vreplication_migrate.yml +++ b/.github/workflows/cluster_endtoend_vreplication_migrate.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vreplication_multicell.yml b/.github/workflows/cluster_endtoend_vreplication_multicell.yml index 308d7742466..f623c7f92fc 100644 --- a/.github/workflows/cluster_endtoend_vreplication_multicell.yml +++ b/.github/workflows/cluster_endtoend_vreplication_multicell.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml index 8bd44e65a27..6c0e184f5e8 100644 --- a/.github/workflows/cluster_endtoend_vreplication_v2.yml +++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vstream_failover.yml b/.github/workflows/cluster_endtoend_vstream_failover.yml index cd61cca3012..f6280cc3403 100644 --- a/.github/workflows/cluster_endtoend_vstream_failover.yml +++ b/.github/workflows/cluster_endtoend_vstream_failover.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml index aad5783819c..3f02a974e8b 100644 --- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml +++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml index 4e0f16d6d61..d826c367471 100644 --- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml +++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml index fd532d1f0d7..864ff102051 100644 --- a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml +++ b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml index 5297e49d59a..3fef6534a4b 100644 --- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml +++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml index 49eaa05a38c..99722220a4f 100644 --- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml +++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml index ae670523e94..db595841e5f 100644 --- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml index 0f59b9cb9b6..d25e3bf337a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml +++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml index a3c8bd25455..d381e5259f4 100644 --- a/.github/workflows/cluster_endtoend_vtgate_queries.yml +++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml index ff5f7363026..23b394ff1d5 100644 --- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml +++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml index 80e9dacf3e9..3276c70f4b4 100644 --- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml +++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml index 50f2d9b3ead..6faa42a1856 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml index 200c8f971a8..6f260c0d154 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml index df177bd472b..a82ccf329fa 100644 --- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml +++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml index b98aafc6d8b..824cbf79210 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml index b7645c05e56..d38199a92e0 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml index ba3cc88b98f..8e8e6eb725b 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml index 3ebbc0da990..c33b9a2df0a 100644 --- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml +++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml index e21cb45f0fd..b2d19638bad 100644 --- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml +++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml index bef4ed5506c..c93b97b3fde 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml index 241bc8f855e..ec9fed05817 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml index d8cbbd4307f..93b57408658 100644 --- a/.github/workflows/cluster_endtoend_vtorc.yml +++ b/.github/workflows/cluster_endtoend_vtorc.yml @@ -72,9 +72,9 @@ jobs: run: | # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml index ff319557d6a..1a89022ec43 100644 --- a/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml +++ b/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml @@ -91,7 +91,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml b/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml index 70840338608..4a3db34aee5 100644 --- a/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml +++ b/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml @@ -91,7 +91,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb # Bionic packages are still compatible for Focal since there's no MySQL 5.7 diff --git a/.github/workflows/e2e_race.yml b/.github/workflows/e2e_race.yml index 73a9ff116fd..b3b327145b8 100644 --- a/.github/workflows/e2e_race.yml +++ b/.github/workflows/e2e_race.yml @@ -56,8 +56,8 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' run: | # Setup MySQL 8.0 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/local_example.yml b/.github/workflows/local_example.yml index 4a6c5285291..1c00c2a3e48 100644 --- a/.github/workflows/local_example.yml +++ b/.github/workflows/local_example.yml @@ -63,8 +63,8 @@ jobs: run: | if [ ${{matrix.os}} = "ubuntu-latest" ]; then # Setup MySQL 8.0 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/region_example.yml b/.github/workflows/region_example.yml index 3703d22696b..2060b5d3280 100644 --- a/.github/workflows/region_example.yml +++ b/.github/workflows/region_example.yml @@ -63,8 +63,8 @@ jobs: run: | if [ ${{matrix.os}} = "ubuntu-latest" ]; then # Setup MySQL 8.0 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml index 1041895a0bd..8cec3180f76 100644 --- a/.github/workflows/unit_test_mysql80.yml +++ b/.github/workflows/unit_test_mysql80.yml @@ -78,7 +78,7 @@ jobs: sudo rm -rf /etc/mysql # Get key to latest MySQL repo - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C # mysql80 wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml index a02591a53cd..569e05bf68a 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml @@ -112,8 +112,8 @@ jobs: sudo rm -rf /etc/mysql # Install MySQL 8.0 ## Temporarily pin the MySQL version at 8.0.28 - #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - #wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + #wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb #echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections #sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* #sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml index 381a6e6daeb..7dad4242083 100644 --- a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml @@ -116,8 +116,8 @@ jobs: # Install MySQL 8.0 ## Temporarily pin the MySQL version at 8.0.28 - #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - #wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + #wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb #echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections #sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* #sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml index ac7d9ba6ecb..06fca074030 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml @@ -104,8 +104,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml index 81f2ff890a0..74811d11a2e 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml @@ -107,8 +107,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml index d6595796f74..f61225a9ec6 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml @@ -104,8 +104,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml index 6b03d471212..5b8124ebe48 100644 --- a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml +++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml @@ -107,8 +107,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml index c5d378bcbdf..c482c9efc53 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml @@ -107,8 +107,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml index fbb5335daa8..fe40b7dbdb3 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml @@ -107,8 +107,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml index 6c81e8c194c..8a0a6d06b95 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml @@ -104,8 +104,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml index 5cbeeef4a9f..50158cdd430 100644 --- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml +++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml @@ -104,8 +104,8 @@ jobs: sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql # Install mysql80 - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update diff --git a/docker/bootstrap/Dockerfile.mysql57 b/docker/bootstrap/Dockerfile.mysql57 index 4e9b335ddac..4d79be9d3ec 100644 --- a/docker/bootstrap/Dockerfile.mysql57 +++ b/docker/bootstrap/Dockerfile.mysql57 @@ -5,7 +5,7 @@ FROM --platform=linux/amd64 "${image}" # Install MySQL 5.7 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg dirmngr ca-certificates && \ - for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com 467B942D3A79BD29 && break; done && \ + for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com A8D3785C && break; done && \ add-apt-repository 'deb http://repo.mysql.com/apt/debian/ buster mysql-5.7' && \ for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 9334A25F8507EFA5 && break; done && \ echo 'deb http://repo.percona.com/apt buster main' > /etc/apt/sources.list.d/percona.list && \ diff --git a/docker/bootstrap/Dockerfile.mysql80 b/docker/bootstrap/Dockerfile.mysql80 index e064c638d99..4bd33522c8d 100644 --- a/docker/bootstrap/Dockerfile.mysql80 +++ b/docker/bootstrap/Dockerfile.mysql80 @@ -5,7 +5,7 @@ FROM --platform=linux/amd64 "${image}" # Install MySQL 8.0 RUN for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com 8C718D3B5072E1F5 && break; done && \ - for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com 467B942D3A79BD29 && break; done && \ + for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com A8D3785C && break; done && \ add-apt-repository 'deb http://repo.mysql.com/apt/debian/ buster mysql-8.0' && \ for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 9334A25F8507EFA5 && break; done && \ echo 'deb http://repo.percona.com/apt buster main' > /etc/apt/sources.list.d/percona.list && \ diff --git a/docker/lite/Dockerfile b/docker/lite/Dockerfile deleted file mode 120000 index c0929ac9ed2..00000000000 --- a/docker/lite/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -Dockerfile.mysql57 \ No newline at end of file diff --git a/docker/lite/Dockerfile b/docker/lite/Dockerfile new file mode 100644 index 00000000000..022a5bc6191 --- /dev/null +++ b/docker/lite/Dockerfile @@ -0,0 +1,58 @@ +# Copyright 2019 The Vitess Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: We have to build the Vitess binaries from scratch instead of sharing +# a base image because Docker Hub dropped the feature we relied upon to +# ensure images contain the right binaries. + +# Use a temporary layer for the build stage. +ARG bootstrap_version=10.2 +ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" + +FROM "${image}" AS builder + +# Allows docker builds to set the BUILD_NUMBER +ARG BUILD_NUMBER + +# Re-copy sources from working tree. +COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess + +# Build and install Vitess in a temporary output directory. +USER vitess +RUN make install PREFIX=/vt/install + +# Start over and build the final image. +FROM debian:buster-slim + +# Install dependencies +COPY docker/lite/install_dependencies.sh /vt/dist/install_dependencies.sh +RUN /vt/dist/install_dependencies.sh mysql57 + +# Set up Vitess user and directory tree. +RUN groupadd -r vitess && useradd -r -g vitess vitess +RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt + +# Set up Vitess environment (just enough to run pre-built Go binaries) +ENV VTROOT /vt/src/vitess.io/vitess +ENV VTDATAROOT /vt/vtdataroot +ENV PATH $VTROOT/bin:$PATH + +# Copy artifacts from builder layer. +COPY --from=builder --chown=vitess:vitess /vt/install /vt +COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/orchestrator /vt/web/orchestrator +COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin + +# Create mount point for actual data (e.g. MySQL data dir) +VOLUME /vt/vtdataroot +USER vitess diff --git a/docker/lite/install_dependencies.sh b/docker/lite/install_dependencies.sh index fce8f8001b2..e5d6426aab2 100755 --- a/docker/lite/install_dependencies.sh +++ b/docker/lite/install_dependencies.sh @@ -146,7 +146,7 @@ case "${FLAVOR}" in mysql57|mysql80) # repo.mysql.com add_apt_key 8C718D3B5072E1F5 - add_apt_key 467B942D3A79BD29 + add_apt_key A8D3785C ;; mariadb|mariadb103) # digitalocean.com diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index 12090f2b40a..0b83da1bc39 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -92,7 +92,7 @@ jobs: # Get key to latest MySQL repo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 # Setup MySQL 8.0 - wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* sudo apt-get update From 9dc9ccb3ea687d138f4d2053cc5b1ac11ea6a852 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:42:09 +0100 Subject: [PATCH 06/12] Address PR comments Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- .../tabletserver/txthrottler/tx_throttler.go | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 6841fa0a1b4..22b2c0799fc 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -21,6 +21,7 @@ import ( "fmt" "math/rand" "sync" + "sync/atomic" "time" "google.golang.org/protobuf/encoding/prototext" @@ -185,6 +186,9 @@ type txThrottlerStateImpl struct { healthCheck discovery.LegacyHealthCheck topologyWatchers []TopologyWatcherInterface + + shardMaxLag atomic.Int64 + endChannel chan bool } // NewTxThrottler tries to construct a txThrottler from the @@ -330,8 +334,9 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar return nil, err } result := &txThrottlerStateImpl{ - config: config, - throttler: t, + config: config, + throttler: t, + endChannel: make(chan bool), } result.healthCheck = healthCheckFactory() result.healthCheck.SetListener(result, false /* sendDownEvents */) @@ -349,6 +354,9 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar discovery.DefaultTopologyWatcherRefreshInterval, discovery.DefaultTopoReadConcurrency)) } + + go result.updateMaxShardLag() + return result, nil } @@ -361,18 +369,31 @@ func (ts *txThrottlerStateImpl) throttle() bool { ts.throttleMu.Lock() defer ts.throttleMu.Unlock() - var maxLag uint32 - - for _, tabletType := range ts.config.tabletTypes { - maxLagPerTabletType := ts.throttler.LastMaxLagNotIgnoredForTabletType(tabletType) - if maxLagPerTabletType > maxLag { - maxLag = maxLagPerTabletType - } - } + maxLag := ts.shardMaxLag.Load() return ts.throttler.Throttle(0 /* threadId */) > 0 && - int64(maxLag) > ts.config.throttlerConfig.TargetReplicationLagSec + maxLag > ts.config.throttlerConfig.TargetReplicationLagSec +} +func (ts *txThrottlerStateImpl) updateMaxShardLag() { + // We use half of the target lag to ensure we have enough resolution to see changes in lag below that value + ticker := time.NewTicker(time.Duration(ts.config.throttlerConfig.TargetReplicationLagSec/2) * time.Second) + for { + select { + case _ = <-ticker.C: + var maxLag uint32 + + for _, tabletType := range ts.config.tabletTypes { + maxLagPerTabletType := ts.throttler.LastMaxLagNotIgnoredForTabletType(tabletType) + if maxLagPerTabletType > maxLag { + maxLag = maxLagPerTabletType + } + } + ts.shardMaxLag.Store(int64(maxLag)) + case _ = <-ts.endChannel: + break + } + } } func (ts *txThrottlerStateImpl) deallocateResources() { @@ -387,6 +408,7 @@ func (ts *txThrottlerStateImpl) deallocateResources() { ts.healthCheck.Close() ts.healthCheck = nil + ts.endChannel <- true // After ts.healthCheck is closed txThrottlerStateImpl.StatsUpdate() is guaranteed not // to be executing, so we can safely close the throttler. ts.throttler.Close() From ee4838ac9670a42513af94aa4c92cddc6b2cb17b Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:30:07 +0100 Subject: [PATCH 07/12] Fix tests Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- .../txthrottler/tx_throttler_test.go | 99 ++++++++++++++----- 1 file changed, 77 insertions(+), 22 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index 65ef64614d1..430d1f2bab0 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -22,11 +22,10 @@ package txthrottler //go:generate mockgen -destination mock_topology_watcher_test.go -package txthrottler vitess.io/vitess/go/vt/vttablet/tabletserver/txthrottler TopologyWatcherInterface import ( - "testing" - "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "testing" + "time" "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/throttler" @@ -55,6 +54,58 @@ func TestDisabledThrottler(t *testing.T) { throttler.Close() } +// mockThrottlerWrapper is used to intercept calls to LastMaxLagNotIgnoredForTabletType so that we can set their output +// value withour worrying about them being called multiple times in a separate go routine. This avoids gomock leading +// to failed tests due to multiple calls. +type mockThrottlerWrapper struct { + mockThrottlerIface *MockThrottlerInterface + lastMaxLagForTabletType map[topodatapb.TabletType]uint32 +} + +func (m mockThrottlerWrapper) Throttle(threadID int) time.Duration { + return m.mockThrottlerIface.Throttle(threadID) +} + +func (m mockThrottlerWrapper) ThreadFinished(threadID int) { + m.mockThrottlerIface.ThreadFinished(threadID) +} + +func (m mockThrottlerWrapper) Close() { + m.mockThrottlerIface.Close() +} + +func (m mockThrottlerWrapper) MaxRate() int64 { + return m.mockThrottlerIface.MaxRate() +} + +func (m mockThrottlerWrapper) SetMaxRate(rate int64) { + m.mockThrottlerIface.SetMaxRate(rate) +} + +func (m mockThrottlerWrapper) RecordReplicationLag(time time.Time, ts *discovery.LegacyTabletStats) { + m.mockThrottlerIface.RecordReplicationLag(time, ts) +} + +func (m mockThrottlerWrapper) GetConfiguration() *throttlerdatapb.Configuration { + return m.mockThrottlerIface.GetConfiguration() +} + +func (m mockThrottlerWrapper) UpdateConfiguration(configuration *throttlerdatapb.Configuration, copyZeroValues bool) error { + return m.mockThrottlerIface.UpdateConfiguration(configuration, copyZeroValues) +} + +func (m mockThrottlerWrapper) ResetConfiguration() { + m.mockThrottlerIface.ResetConfiguration() +} + +func (m mockThrottlerWrapper) EXPECT() *MockThrottlerInterfaceMockRecorder { + return m.mockThrottlerIface.EXPECT() +} + +func (m mockThrottlerWrapper) LastMaxLagNotIgnoredForTabletType(tabletType topodatapb.TabletType) uint32 { + return m.lastMaxLagForTabletType[tabletType] +} + func TestEnabledThrottler(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() @@ -83,7 +134,16 @@ func TestEnabledThrottler(t *testing.T) { return result } + //mockThrottler := mockThrottlerWrapper{ + // mockThrottlerIface: NewMockThrottlerInterface(mockCtrl), + // lastMaxLagForTabletType: map[topodatapb.TabletType]uint32{ + // topodatapb.TabletType_REPLICA: 0, + // topodatapb.TabletType_RDONLY: 0, + // }, + //} + mockThrottler := NewMockThrottlerInterface(mockCtrl) + throttlerFactory = func(name, unit string, threadCount int, maxRate int64, maxReplicationLagConfig throttler.MaxReplicationLagModuleConfig) (ThrottlerInterface, error) { assert.Equal(t, 1, threadCount) return mockThrottler, nil @@ -94,10 +154,7 @@ func TestEnabledThrottler(t *testing.T) { call := mockThrottler.EXPECT().UpdateConfiguration(gomock.Any(), true /* copyZeroValues */) calls = append(calls, call) - call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) - call.Return(uint32(20)) - calls = append(calls, call) - + // 1 call = mockThrottler.EXPECT().Throttle(0) call.Return(0 * time.Second) calls = append(calls, call) @@ -111,26 +168,17 @@ func TestEnabledThrottler(t *testing.T) { call = mockThrottler.EXPECT().RecordReplicationLag(gomock.Any(), tabletStats) calls = append(calls, call) - call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) - call.Return(uint32(20)) - calls = append(calls, call) - + // 2 call = mockThrottler.EXPECT().Throttle(0) call.Return(1 * time.Second) calls = append(calls, call) - call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) - call.Return(uint32(20)) - calls = append(calls, call) - + // 3 call = mockThrottler.EXPECT().Throttle(0) call.Return(1 * time.Second) calls = append(calls, call) - call = mockThrottler.EXPECT().LastMaxLagNotIgnoredForTabletType(topodatapb.TabletType_REPLICA) - call.Return(uint32(1)) - calls = append(calls, call) - + // 4 call = mockThrottler.EXPECT().Throttle(0) call.Return(1 * time.Second) calls = append(calls, call) @@ -157,6 +205,11 @@ func TestEnabledThrottler(t *testing.T) { assert.Nil(t, throttler.Open()) assert.Equal(t, int64(1), throttler.throttlerRunning.Get()) + throttlerImpl, ok := throttler.state.(*txThrottlerStateImpl) + assert.True(t, ok) + + // 1 should not throttle due to return value of underlying Throttle(), despite high lag + throttlerImpl.shardMaxLag.Store(20) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(1), throttler.requestsTotal.Counts()["some-workload"]) assert.Zero(t, throttler.requestsThrottled.Counts()["some-workload"]) @@ -169,17 +222,19 @@ func TestEnabledThrottler(t *testing.T) { } // This call should not be forwarded to the go/vt/throttler.Throttler object. hcListener.StatsUpdate(rdonlyTabletStats) - // The second throttle call should reject. + + // 2 should throttle due to return value of underlying Throttle(), high lag & priority = 100 assert.True(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(2), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) - // This call should not throttle due to priority. Check that's the case and counters agree. + // 3 should not throttle despite return value of underlying Throttle() and high lag, due to priority = 0 assert.False(t, throttler.Throttle(0, "some-workload")) assert.Equal(t, int64(3), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) - // This call should not throttle despite priority. Check that's the case and counters agree. + // 4 should not throttle despite return value of underlying Throttle() and priority = 100, due to low lag + assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(4), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) From 38fb7b94eaf5826e72ba3e38d49128abbbb7f3f7 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:44:59 +0100 Subject: [PATCH 08/12] Remove useless changes Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go.sum | 1 - .../txthrottler/tx_throttler_test.go | 62 +------------------ 2 files changed, 1 insertion(+), 62 deletions(-) diff --git a/go.sum b/go.sum index 6ce1df5e358..cc300ba3899 100644 --- a/go.sum +++ b/go.sum @@ -169,7 +169,6 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index 430d1f2bab0..c671e2ec5ee 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -54,58 +54,6 @@ func TestDisabledThrottler(t *testing.T) { throttler.Close() } -// mockThrottlerWrapper is used to intercept calls to LastMaxLagNotIgnoredForTabletType so that we can set their output -// value withour worrying about them being called multiple times in a separate go routine. This avoids gomock leading -// to failed tests due to multiple calls. -type mockThrottlerWrapper struct { - mockThrottlerIface *MockThrottlerInterface - lastMaxLagForTabletType map[topodatapb.TabletType]uint32 -} - -func (m mockThrottlerWrapper) Throttle(threadID int) time.Duration { - return m.mockThrottlerIface.Throttle(threadID) -} - -func (m mockThrottlerWrapper) ThreadFinished(threadID int) { - m.mockThrottlerIface.ThreadFinished(threadID) -} - -func (m mockThrottlerWrapper) Close() { - m.mockThrottlerIface.Close() -} - -func (m mockThrottlerWrapper) MaxRate() int64 { - return m.mockThrottlerIface.MaxRate() -} - -func (m mockThrottlerWrapper) SetMaxRate(rate int64) { - m.mockThrottlerIface.SetMaxRate(rate) -} - -func (m mockThrottlerWrapper) RecordReplicationLag(time time.Time, ts *discovery.LegacyTabletStats) { - m.mockThrottlerIface.RecordReplicationLag(time, ts) -} - -func (m mockThrottlerWrapper) GetConfiguration() *throttlerdatapb.Configuration { - return m.mockThrottlerIface.GetConfiguration() -} - -func (m mockThrottlerWrapper) UpdateConfiguration(configuration *throttlerdatapb.Configuration, copyZeroValues bool) error { - return m.mockThrottlerIface.UpdateConfiguration(configuration, copyZeroValues) -} - -func (m mockThrottlerWrapper) ResetConfiguration() { - m.mockThrottlerIface.ResetConfiguration() -} - -func (m mockThrottlerWrapper) EXPECT() *MockThrottlerInterfaceMockRecorder { - return m.mockThrottlerIface.EXPECT() -} - -func (m mockThrottlerWrapper) LastMaxLagNotIgnoredForTabletType(tabletType topodatapb.TabletType) uint32 { - return m.lastMaxLagForTabletType[tabletType] -} - func TestEnabledThrottler(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() @@ -134,14 +82,6 @@ func TestEnabledThrottler(t *testing.T) { return result } - //mockThrottler := mockThrottlerWrapper{ - // mockThrottlerIface: NewMockThrottlerInterface(mockCtrl), - // lastMaxLagForTabletType: map[topodatapb.TabletType]uint32{ - // topodatapb.TabletType_REPLICA: 0, - // topodatapb.TabletType_RDONLY: 0, - // }, - //} - mockThrottler := NewMockThrottlerInterface(mockCtrl) throttlerFactory = func(name, unit string, threadCount int, maxRate int64, maxReplicationLagConfig throttler.MaxReplicationLagModuleConfig) (ThrottlerInterface, error) { @@ -234,7 +174,7 @@ func TestEnabledThrottler(t *testing.T) { assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) // 4 should not throttle despite return value of underlying Throttle() and priority = 100, due to low lag - + throttlerImpl.shardMaxLag.Store(1) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(4), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) From 01095bc5efa540ed206fa134afdc0436ecd4c5c9 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:46:38 +0100 Subject: [PATCH 09/12] Remove useless changes Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index c671e2ec5ee..b23c1a2b062 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -22,11 +22,12 @@ package txthrottler //go:generate mockgen -destination mock_topology_watcher_test.go -package txthrottler vitess.io/vitess/go/vt/vttablet/tabletserver/txthrottler TopologyWatcherInterface import ( - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/assert" "testing" "time" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/assert" + "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/throttler" "vitess.io/vitess/go/vt/topo" From 0f40692deaf4c10d886315d697cf0c013a36e32a Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:08:32 +0100 Subject: [PATCH 10/12] Replace aotmic.Int64 with atomic.(Load|Store)Int64 to avoid CI issues Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go | 6 +++--- .../tabletserver/txthrottler/tx_throttler_test.go | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 22b2c0799fc..620656bfa6a 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -187,7 +187,7 @@ type txThrottlerStateImpl struct { healthCheck discovery.LegacyHealthCheck topologyWatchers []TopologyWatcherInterface - shardMaxLag atomic.Int64 + shardMaxLag int64 endChannel chan bool } @@ -369,7 +369,7 @@ func (ts *txThrottlerStateImpl) throttle() bool { ts.throttleMu.Lock() defer ts.throttleMu.Unlock() - maxLag := ts.shardMaxLag.Load() + maxLag := atomic.LoadInt64(&ts.shardMaxLag) return ts.throttler.Throttle(0 /* threadId */) > 0 && maxLag > ts.config.throttlerConfig.TargetReplicationLagSec @@ -389,7 +389,7 @@ func (ts *txThrottlerStateImpl) updateMaxShardLag() { maxLag = maxLagPerTabletType } } - ts.shardMaxLag.Store(int64(maxLag)) + atomic.StoreInt64(&ts.shardMaxLag, int64(maxLag)) case _ = <-ts.endChannel: break } diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index b23c1a2b062..8311638e017 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -22,6 +22,7 @@ package txthrottler //go:generate mockgen -destination mock_topology_watcher_test.go -package txthrottler vitess.io/vitess/go/vt/vttablet/tabletserver/txthrottler TopologyWatcherInterface import ( + "sync/atomic" "testing" "time" @@ -148,9 +149,12 @@ func TestEnabledThrottler(t *testing.T) { throttlerImpl, ok := throttler.state.(*txThrottlerStateImpl) assert.True(t, ok) + // Stop the go routine that keeps updating the cached shard's max lag to preventi it from changing the value in a + // way that will interfere with how we manipulate that value in our tests to evaluate different cases: + throttlerImpl.endChannel <- true // 1 should not throttle due to return value of underlying Throttle(), despite high lag - throttlerImpl.shardMaxLag.Store(20) + atomic.StoreInt64(&throttlerImpl.shardMaxLag, 20) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(1), throttler.requestsTotal.Counts()["some-workload"]) assert.Zero(t, throttler.requestsThrottled.Counts()["some-workload"]) @@ -175,7 +179,7 @@ func TestEnabledThrottler(t *testing.T) { assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) // 4 should not throttle despite return value of underlying Throttle() and priority = 100, due to low lag - throttlerImpl.shardMaxLag.Store(1) + atomic.StoreInt64(&throttlerImpl.shardMaxLag, 1) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(4), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) From e656e734be86576740a470061ce8d7db41483229 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:49:17 +0100 Subject: [PATCH 11/12] Fix unit tests race Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- .../tabletserver/txthrottler/tx_throttler.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 620656bfa6a..2ecc0b8fa45 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -187,8 +187,9 @@ type txThrottlerStateImpl struct { healthCheck discovery.LegacyHealthCheck topologyWatchers []TopologyWatcherInterface - shardMaxLag int64 - endChannel chan bool + shardMaxLag int64 + endChannel chan bool + endWaitGroup sync.WaitGroup } // NewTxThrottler tries to construct a txThrottler from the @@ -336,7 +337,7 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar result := &txThrottlerStateImpl{ config: config, throttler: t, - endChannel: make(chan bool), + endChannel: make(chan bool, 1), } result.healthCheck = healthCheckFactory() result.healthCheck.SetListener(result, false /* sendDownEvents */) @@ -355,6 +356,7 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar discovery.DefaultTopoReadConcurrency)) } + result.endWaitGroup.Add(1) go result.updateMaxShardLag() return result, nil @@ -376,11 +378,13 @@ func (ts *txThrottlerStateImpl) throttle() bool { } func (ts *txThrottlerStateImpl) updateMaxShardLag() { + defer ts.endWaitGroup.Done() // We use half of the target lag to ensure we have enough resolution to see changes in lag below that value ticker := time.NewTicker(time.Duration(ts.config.throttlerConfig.TargetReplicationLagSec/2) * time.Second) +outerloop: for { select { - case _ = <-ticker.C: + case <-ticker.C: var maxLag uint32 for _, tabletType := range ts.config.tabletTypes { @@ -390,8 +394,8 @@ func (ts *txThrottlerStateImpl) updateMaxShardLag() { } } atomic.StoreInt64(&ts.shardMaxLag, int64(maxLag)) - case _ = <-ts.endChannel: - break + case <-ts.endChannel: + break outerloop } } } @@ -409,6 +413,7 @@ func (ts *txThrottlerStateImpl) deallocateResources() { ts.healthCheck = nil ts.endChannel <- true + ts.endWaitGroup.Wait() // After ts.healthCheck is closed txThrottlerStateImpl.StatsUpdate() is guaranteed not // to be executing, so we can safely close the throttler. ts.throttler.Close() From 7a086fc0267feda1e95f4e0fbf1397588c32c928 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U" <5791035+ejortegau@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:36:36 +0100 Subject: [PATCH 12/12] Address upstream PR comments Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com> --- go/vt/throttler/throttler.go | 4 +- .../txthrottler/mock_throttler_test.go | 12 +++--- .../tabletserver/txthrottler/tx_throttler.go | 40 +++++++++---------- .../txthrottler/tx_throttler_test.go | 16 ++++---- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/go/vt/throttler/throttler.go b/go/vt/throttler/throttler.go index 73ad66fe92d..c071f0694a6 100644 --- a/go/vt/throttler/throttler.go +++ b/go/vt/throttler/throttler.go @@ -226,9 +226,9 @@ func (t *Throttler) Throttle(threadID int) time.Duration { return t.threadThrottlers[threadID].throttle(t.nowFunc()) } -// LastMaxLagNotIgnoredForTabletType returns the max of all the last replication lag values seen across all tablets of +// MaxLag returns the max of all the last replication lag values seen across all tablets of // the provided type, excluding ignored tablets. -func (t *Throttler) LastMaxLagNotIgnoredForTabletType(tabletType topodata.TabletType) uint32 { +func (t *Throttler) MaxLag(tabletType topodata.TabletType) uint32 { cache := t.maxReplicationLagModule.lagCacheByType(tabletType) var maxLag uint32 diff --git a/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go index 75daf37c5a0..76a02c121b7 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/mock_throttler_test.go @@ -64,18 +64,18 @@ func (mr *MockThrottlerInterfaceMockRecorder) GetConfiguration() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfiguration", reflect.TypeOf((*MockThrottlerInterface)(nil).GetConfiguration)) } -// LastMaxLagNotIgnoredForTabletType mocks base method. -func (m *MockThrottlerInterface) LastMaxLagNotIgnoredForTabletType(tabletType topodata.TabletType) uint32 { +// MaxLag mocks base method. +func (m *MockThrottlerInterface) MaxLag(tabletType topodata.TabletType) uint32 { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LastMaxLagNotIgnoredForTabletType", tabletType) + ret := m.ctrl.Call(m, "MaxLag", tabletType) ret0, _ := ret[0].(uint32) return ret0 } -// LastMaxLagNotIgnoredForTabletType indicates an expected call of LastMaxLagNotIgnoredForTabletType. -func (mr *MockThrottlerInterfaceMockRecorder) LastMaxLagNotIgnoredForTabletType(tabletType interface{}) *gomock.Call { +// MaxLag indicates an expected call of MaxLag. +func (mr *MockThrottlerInterfaceMockRecorder) MaxLag(tabletType interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMaxLagNotIgnoredForTabletType", reflect.TypeOf((*MockThrottlerInterface)(nil).LastMaxLagNotIgnoredForTabletType), tabletType) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxLag", reflect.TypeOf((*MockThrottlerInterface)(nil).MaxLag), tabletType) } // MaxRate mocks base method. diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 2ecc0b8fa45..18593bc73cb 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -87,7 +87,7 @@ type ThrottlerInterface interface { GetConfiguration() *throttlerdatapb.Configuration UpdateConfiguration(configuration *throttlerdatapb.Configuration, copyZeroValues bool) error ResetConfiguration() - LastMaxLagNotIgnoredForTabletType(tabletType topodatapb.TabletType) uint32 + MaxLag(tabletType topodatapb.TabletType) uint32 } // TopologyWatcherInterface defines the public interface that is implemented by @@ -187,9 +187,9 @@ type txThrottlerStateImpl struct { healthCheck discovery.LegacyHealthCheck topologyWatchers []TopologyWatcherInterface - shardMaxLag int64 - endChannel chan bool - endWaitGroup sync.WaitGroup + maxLag int64 + done chan bool + waitForTermination sync.WaitGroup } // NewTxThrottler tries to construct a txThrottler from the @@ -307,7 +307,7 @@ func (t *txThrottler) Throttle(priority int, workload string) (result bool) { // Throttle according to both what the throttler state says and the priority. Workloads with lower priority value // are less likely to be throttled. - result = t.state.throttle() && rand.Intn(sqlparser.MaxPriorityValue) < priority + result = rand.Intn(sqlparser.MaxPriorityValue) < priority && t.state.throttle() t.requestsTotal.Add(workload, 1) if result { @@ -335,9 +335,9 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar return nil, err } result := &txThrottlerStateImpl{ - config: config, - throttler: t, - endChannel: make(chan bool, 1), + config: config, + throttler: t, + done: make(chan bool, 1), } result.healthCheck = healthCheckFactory() result.healthCheck.SetListener(result, false /* sendDownEvents */) @@ -356,8 +356,8 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, tar discovery.DefaultTopoReadConcurrency)) } - result.endWaitGroup.Add(1) - go result.updateMaxShardLag() + result.waitForTermination.Add(1) + go result.updateMaxLag() return result, nil } @@ -371,14 +371,14 @@ func (ts *txThrottlerStateImpl) throttle() bool { ts.throttleMu.Lock() defer ts.throttleMu.Unlock() - maxLag := atomic.LoadInt64(&ts.shardMaxLag) + maxLag := atomic.LoadInt64(&ts.maxLag) - return ts.throttler.Throttle(0 /* threadId */) > 0 && - maxLag > ts.config.throttlerConfig.TargetReplicationLagSec + return maxLag > ts.config.throttlerConfig.TargetReplicationLagSec && + ts.throttler.Throttle(0 /* threadId */) > 0 } -func (ts *txThrottlerStateImpl) updateMaxShardLag() { - defer ts.endWaitGroup.Done() +func (ts *txThrottlerStateImpl) updateMaxLag() { + defer ts.waitForTermination.Done() // We use half of the target lag to ensure we have enough resolution to see changes in lag below that value ticker := time.NewTicker(time.Duration(ts.config.throttlerConfig.TargetReplicationLagSec/2) * time.Second) outerloop: @@ -388,13 +388,13 @@ outerloop: var maxLag uint32 for _, tabletType := range ts.config.tabletTypes { - maxLagPerTabletType := ts.throttler.LastMaxLagNotIgnoredForTabletType(tabletType) + maxLagPerTabletType := ts.throttler.MaxLag(tabletType) if maxLagPerTabletType > maxLag { maxLag = maxLagPerTabletType } } - atomic.StoreInt64(&ts.shardMaxLag, int64(maxLag)) - case <-ts.endChannel: + atomic.StoreInt64(&ts.maxLag, int64(maxLag)) + case <-ts.done: break outerloop } } @@ -412,8 +412,8 @@ func (ts *txThrottlerStateImpl) deallocateResources() { ts.healthCheck.Close() ts.healthCheck = nil - ts.endChannel <- true - ts.endWaitGroup.Wait() + ts.done <- true + ts.waitForTermination.Wait() // After ts.healthCheck is closed txThrottlerStateImpl.StatsUpdate() is guaranteed not // to be executing, so we can safely close the throttler. ts.throttler.Close() diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index 8311638e017..a3e4d219da3 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -116,14 +116,12 @@ func TestEnabledThrottler(t *testing.T) { calls = append(calls, call) // 3 - call = mockThrottler.EXPECT().Throttle(0) - call.Return(1 * time.Second) - calls = append(calls, call) + // Nothing gets mocked here because the order of evaluation in txThrottler.Throttle() evaluates first + // whether the priority allows for throttling or not, so no need to mock calls in mockThrottler.Throttle() // 4 - call = mockThrottler.EXPECT().Throttle(0) - call.Return(1 * time.Second) - calls = append(calls, call) + // Nothing gets mocked here because the order of evaluation in txThrottlerStateImpl.Throttle() evaluates first + // whether there is lag or not, so no call to the underlying mockThrottler is issued. call = mockThrottler.EXPECT().Close() calls = append(calls, call) @@ -151,10 +149,10 @@ func TestEnabledThrottler(t *testing.T) { assert.True(t, ok) // Stop the go routine that keeps updating the cached shard's max lag to preventi it from changing the value in a // way that will interfere with how we manipulate that value in our tests to evaluate different cases: - throttlerImpl.endChannel <- true + throttlerImpl.done <- true // 1 should not throttle due to return value of underlying Throttle(), despite high lag - atomic.StoreInt64(&throttlerImpl.shardMaxLag, 20) + atomic.StoreInt64(&throttlerImpl.maxLag, 20) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(1), throttler.requestsTotal.Counts()["some-workload"]) assert.Zero(t, throttler.requestsThrottled.Counts()["some-workload"]) @@ -179,7 +177,7 @@ func TestEnabledThrottler(t *testing.T) { assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"]) // 4 should not throttle despite return value of underlying Throttle() and priority = 100, due to low lag - atomic.StoreInt64(&throttlerImpl.shardMaxLag, 1) + atomic.StoreInt64(&throttlerImpl.maxLag, 1) assert.False(t, throttler.Throttle(100, "some-workload")) assert.Equal(t, int64(4), throttler.requestsTotal.Counts()["some-workload"]) assert.Equal(t, int64(1), throttler.requestsThrottled.Counts()["some-workload"])