Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tablet throttler: throttler-config-via-topo defaults 'true', deprecation message for old flags #13130

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
920d6ab
Table throttler: --throttler-config-via-topo now defaults to 'true'
shlomi-noach May 22, 2023
7c2ed12
add deprecation message
shlomi-noach May 23, 2023
018b680
endtoend tests: remove '--enable-lag-throttler' and use 'UpdateThrott…
shlomi-noach May 23, 2023
930fb2c
always use vtctldclient
shlomi-noach May 23, 2023
2903164
use cluster.VtctldClientProcess
shlomi-noach May 23, 2023
681e401
disable --throttler-config-via-topo in old throttler tests
shlomi-noach May 23, 2023
5aea00b
Remove --throttler-config-via-topo where used, since it now defaults …
shlomi-noach May 23, 2023
7e5b0fb
fix vreplication cluster setup, waiting for throttler config to apply
shlomi-noach May 23, 2023
3402fcc
changelog
shlomi-noach May 23, 2023
6b02492
extend throttler threshold
shlomi-noach May 23, 2023
e3b8dd1
a bit more verbose
shlomi-noach May 23, 2023
9bd46a2
fixed CLI test
shlomi-noach May 23, 2023
c6b9a21
remove old '--enable-lag-throttler' flag, introduce '--heartbeat_on_d…
shlomi-noach May 23, 2023
4c7a944
Merge branch 'main' into throttler-config-default-enable
shlomi-noach May 24, 2023
2979d00
more log info in throttler.Open()
shlomi-noach May 24, 2023
0890c75
more logging
shlomi-noach May 24, 2023
3c893c5
Merge branch 'throttler-config-default-enable' of github.com:planetsc…
shlomi-noach May 24, 2023
3d3f6b2
Revert to --heartbeat_enable
shlomi-noach May 30, 2023
cd2cc1b
Protect throttler config change application with initMutex
mattlord May 31, 2023
7c5b416
More CI testing
mattlord May 31, 2023
82b7385
CI testing cont
mattlord May 31, 2023
5854273
Yes...
mattlord May 31, 2023
5efdc96
Somebody doesn't like force pushes so msg here
mattlord May 31, 2023
5a60e39
Increase on-demand heartbeat duration from 10s to 1m
mattlord May 31, 2023
34e5dd8
Use only on-demand heartbeats everywhere
mattlord May 31, 2023
c420c4a
Use same throttler config everywhere
mattlord May 31, 2023
e03df30
Update all keyspaces and don't fail test on missing JSON keys
mattlord May 31, 2023
70570a5
Use constant heartbeats in vrepl e2e tests
mattlord May 31, 2023
dc7b397
Increase workflow command timeout
mattlord May 31, 2023
0fc37df
Don't wait for throttler on non-serving primaries
mattlord May 31, 2023
a02478d
Merge branch 'main' into throttler-config-default-enable
shlomi-noach Jun 1, 2023
11ca17a
https://github.com/vitessio/vitess/issues/13175 is fixed, therefore r…
shlomi-noach Jun 1, 2023
065fd16
Merge remote-tracking branch 'upstream/main' into throttler-config-de…
shlomi-noach Jun 1, 2023
f4d277d
Added ToC
shlomi-noach Jun 1, 2023
b7c0419
Merge branch 'main' into throttler-config-default-enable
shlomi-noach Jun 1, 2023
0de6a72
Tweak comment and kick CI
mattlord Jun 1, 2023
261b06a
Treat isOpen as the ready/running signal.
mattlord Jun 1, 2023
d9bfece
Re-adjust comment
mattlord Jun 1, 2023
d6a9f33
Adjust CheckIsReady() to match OnlineDDL's expectation/usage
mattlord Jun 1, 2023
bbbb351
Get rid of log messages from SrvKeyspaceWatcher when no node/key
mattlord Jun 1, 2023
48e71a5
More corrections/tweaks
mattlord Jun 1, 2023
9aef276
Use more convenient/clear new IsRunning function
mattlord Jun 1, 2023
fc12e4a
Revert "Use more convenient/clear new IsRunning function"
mattlord Jun 1, 2023
ba7aa05
Further fix correct use of IsOpen(), IsRunning(), IsEnabled()
shlomi-noach Jun 4, 2023
af0ea43
throttler.throttledApps cannot be nil
shlomi-noach Jun 4, 2023
0b867f2
minor refactory/beautify for test
shlomi-noach Jun 5, 2023
d3985f4
fix flakiness of tabletmanager_throttler_topo test by: (1) proper wai…
shlomi-noach Jun 5, 2023
08cd1e5
Fix typo in release notes
mattlord Jun 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/17.0/17.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- **[New command line flags and behavior](#new-flag)**
- [Builtin backup: read buffering flags](#builtin-backup-read-buffering-flags)
- [Manifest backup external decompressor command](#manifest-backup-external-decompressor-command)
- [Throttler config via topo enabled by default](#throttler-config-via-topo)
- **[New stats](#new-stats)**
- [Detailed backup and restore stats](#detailed-backup-and-restore-stats)
- [VTtablet Error count with code](#vttablet-error-count-with-code)
Expand Down Expand Up @@ -164,6 +165,12 @@ This feature enables the following flow:
```
2. Restore that backup with a mere `Restore` command, without having to specify `--external-decompressor`.

#### <a id="throttler-config-via-topo" />vttablet --throttler-config-via-topo

This flag was introduced in v16 and defaulted to `false`. In v17 it defaults to `true`, and there is no need to supply it.

Note that this flag overrides `--enable-lag-throttler` and `--throttle-threshold`, which now give warnings, and will be removed in v18.

### <a id="new-stats"/>New stats

#### <a id="detailed-backup-and-restore-stats"/>Detailed backup and restore stats
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Usage of vttablet:
--throttle_metrics_threshold float Override default throttle threshold, respective to --throttle_metrics_query (default 1.7976931348623157e+308)
--throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' aways implicitly included (default "replica")
--throttle_threshold duration Replication lag threshold for default lag throttling (default 1s)
--throttler-config-via-topo When 'true', read config from topo service and ignore throttle_threshold, throttle_metrics_threshold, throttle_metrics_query, throttle_check_as_check_self
--throttler-config-via-topo When 'true', read config from topo service and ignore throttle_threshold, throttle_metrics_threshold, throttle_metrics_query, throttle_check_as_check_self (default true)
--topo_consul_lock_delay duration LockDelay for consul session. (default 15s)
--topo_consul_lock_session_checks string List of checks for consul session. (default "serfHealth")
--topo_consul_lock_session_ttl string TTL for consul session.
Expand Down
7 changes: 4 additions & 3 deletions go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -166,9 +167,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -218,6 +216,9 @@ func TestSchemaChange(t *testing.T) {
defer cluster.PanicHandler(t)
shards = clusterInstance.Keyspaces[0].Shards
assert.Equal(t, 2, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

testWithInitialSchema(t)
t.Run("create non_online", func(t *testing.T) {
_ = testOnlineDDLStatement(t, alterTableNormalStatement, string(schema.DDLStrategyDirect), "vtctl", "non_online", "")
Expand Down
6 changes: 3 additions & 3 deletions go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -150,9 +151,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -205,6 +203,8 @@ func TestSchemaChange(t *testing.T) {
shards = clusterInstance.Keyspaces[0].Shards
require.Equal(t, 1, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

t.Run("revertible", testRevertible)
t.Run("revert", testRevert)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -187,9 +188,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--watch_replication_stream",
Expand Down Expand Up @@ -234,6 +232,9 @@ func TestMain(m *testing.M) {
}

func TestSchemaChange(t *testing.T) {

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

t.Run("scheduler", testScheduler)
t.Run("singleton", testSingleton)
t.Run("declarative", testDeclarative)
Expand Down
4 changes: 1 addition & 3 deletions go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--throttler-config-via-topo",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -259,7 +257,7 @@ func TestSchemaChange(t *testing.T) {
err := clusterInstance.WaitForTabletsToHealthyInVtgate()
require.NoError(t, err)

_, err = throttler.UpdateThrottlerTopoConfig(clusterInstance, true, false, 0, "", false)
_, err = throttler.UpdateThrottlerTopoConfig(clusterInstance, true, false, 0, "")
require.NoError(t, err)

for _, ks := range clusterInstance.Keyspaces {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -177,9 +178,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -232,6 +230,8 @@ func TestSchemaChange(t *testing.T) {
shards = clusterInstance.Keyspaces[0].Shards
require.Equal(t, 1, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

t.Run("create schema", func(t *testing.T) {
assert.Equal(t, 1, len(clusterInstance.Keyspaces[0].Shards))
testWithInitialSchema(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -429,9 +430,6 @@ func TestMain(m *testing.M) {
// thereby examining lastPK on vcopier side. We will be iterating tables using non-PK order throughout
// this test suite, and so the low setting ensures we hit the more interesting code paths.
clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -485,6 +483,8 @@ func TestSchemaChange(t *testing.T) {
shards = clusterInstance.Keyspaces[0].Shards
require.Equal(t, 1, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

for _, testcase := range testCases {
require.NotEmpty(t, testcase.name)
t.Run(testcase.name, func(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -82,9 +83,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -134,6 +132,8 @@ func TestSchemaChange(t *testing.T) {
shards := clusterInstance.Keyspaces[0].Shards
require.Equal(t, 1, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

files, err := os.ReadDir(testDataPath)
require.NoError(t, err)
for _, f := range files {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"regexp"
"strings"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -33,6 +34,7 @@ import (
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/onlineddl"
"vitess.io/vitess/go/test/endtoend/throttler"
"vitess.io/vitess/go/vt/schemadiff"
"vitess.io/vitess/go/vt/sqlparser"
)
Expand Down Expand Up @@ -87,9 +89,6 @@ func TestMain(m *testing.M) {
}

clusterInstance.VtTabletExtraArgs = []string{
"--enable-lag-throttler",
"--throttle_threshold", "1s",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
Expand Down Expand Up @@ -139,6 +138,8 @@ func TestSchemaChange(t *testing.T) {
shards := clusterInstance.Keyspaces[0].Shards
require.Equal(t, 1, len(shards))

throttler.EnableLagThrottlerAndWaitForStatus(t, clusterInstance, time.Second)

files, err := os.ReadDir(testDataPath)
require.NoError(t, err)
for _, f := range files {
Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/tabletmanager/tablegc/tablegc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func TestMain(m *testing.M) {
"--lock_tables_timeout", "5s",
"--watch_replication_stream",
"--enable_replication_reporter",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--gc_check_interval", gcCheckInterval.String(),
"--gc_purge_check_interval", gcPurgeCheckInterval.String(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ func TestMain(m *testing.M) {

// Set extra tablet args for lock timeout
clusterInstance.VtTabletExtraArgs = []string{
"--throttler-config-via-topo=false",
"--lock_tables_timeout", "5s",
"--watch_replication_stream",
"--enable_replication_reporter",
"--enable-lag-throttler",
"--throttle_threshold", throttlerThreshold.String(),
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
"--heartbeat_on_demand_duration", onDemandHeartbeatDuration.String(),
"--disable_active_reparents",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ func TestMain(m *testing.M) {

// Set extra tablet args for lock timeout
clusterInstance.VtTabletExtraArgs = []string{
"--throttler-config-via-topo=false",
"--lock_tables_timeout", "5s",
"--watch_replication_stream",
"--enable_replication_reporter",
"--enable-lag-throttler",
"--throttle_metrics_query", "show global status like 'threads_running'",
"--throttle_metrics_threshold", fmt.Sprintf("%d", testThreshold),
"--throttle_check_as_check_self",
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
}

Expand Down
Loading