Skip to content

Commit

Permalink
rpk: add fetch_reads_debounce_timeout:10 to mode dev-container
Browse files Browse the repository at this point in the history
Useful for trading latency and "hot" polling.

Fixes redpanda-data#5661
  • Loading branch information
r-vasquez committed Oct 31, 2022
1 parent 8f45183 commit a791079
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/go/rpk/pkg/cli/cmd/redpanda/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ func setContainerModeCfgFields(cfg *config.Config) {
cfg.Redpanda.Other["group_topic_partitions"] = 3
cfg.Redpanda.Other["storage_min_free_bytes"] = 10485760
cfg.Redpanda.Other["topic_partitions_per_shard"] = 1000
cfg.Redpanda.Other["fetch_reads_debounce_timeout"] = 10
}

func getOrFindInstallDir(fs afero.Fs, installDir string) (string, error) {
Expand Down
32 changes: 18 additions & 14 deletions src/go/rpk/pkg/cli/cmd/redpanda/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ func TestStartCommand(t *testing.T) {
// We are adding now this cluster properties as default with
// redpanda.developer_mode: true.
c.Redpanda.Other = map[string]interface{}{
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"fetch_reads_debounce_timeout": 10,
}

conf, err := new(config.Params).Load(fs)
Expand Down Expand Up @@ -1404,10 +1405,11 @@ func TestStartCommand(t *testing.T) {
require.Nil(st, conf.Redpanda.ID)
require.Equal(st, true, conf.Redpanda.DeveloperMode)
expectedClusterFields := map[string]interface{}{
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"fetch_reads_debounce_timeout": 10,
}
require.Equal(st, expectedClusterFields, conf.Redpanda.Other)
},
Expand Down Expand Up @@ -1453,10 +1455,11 @@ func TestStartCommand(t *testing.T) {

// Config:
expectedClusterFields := map[string]interface{}{
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"auto_create_topics_enabled": true,
"group_topic_partitions": 3,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"fetch_reads_debounce_timeout": 10,
}
require.Nil(st, conf.Redpanda.ID)
require.Equal(st, true, conf.Redpanda.DeveloperMode)
Expand Down Expand Up @@ -1495,8 +1498,9 @@ func TestStartCommand(t *testing.T) {
"auto_create_topics_enabled": false,
"group_topic_partitions": 1,
// rest of --mode dev-container cfg fields
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"storage_min_free_bytes": 10485760,
"topic_partitions_per_shard": 1000,
"fetch_reads_debounce_timeout": 10,
}
require.Exactly(st, expectedClusterFields, conf.Redpanda.Other)
},
Expand Down
3 changes: 2 additions & 1 deletion tests/rptest/tests/rpk_start_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def test_container_mode(self):
"auto_create_topics_enabled": "true",
"group_topic_partitions": "3",
"storage_min_free_bytes": "10485760",
"topic_partitions_per_shard": "1000"
"topic_partitions_per_shard": "1000",
"fetch_reads_debounce_timeout": "10",
}

for p in expected_cluster_properties:
Expand Down

0 comments on commit a791079

Please sign in to comment.