From c382594273fa3226da37fbbc75fb5fe0fcac0f64 Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Fri, 4 Sep 2020 15:18:26 -0700 Subject: [PATCH 1/2] feat: Expose a subset of InfluxQL coordinator tuning options Closes #19507 --- cmd/influxd/launcher/launcher.go | 36 ++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/cmd/influxd/launcher/launcher.go b/cmd/influxd/launcher/launcher.go index 40f0c1356b3..f24fabe3d20 100644 --- a/cmd/influxd/launcher/launcher.go +++ b/cmd/influxd/launcher/launcher.go @@ -435,6 +435,23 @@ func launcherOpts(l *Launcher) []cli.Opt { Flag: "storage-tsm-use-madv-willneed", Desc: "Controls whether we hint to the kernel that we intend to page in mmap'd sections of TSM files.", }, + + // InfluxQL Coordinator Config + { + DestP: &l.CoordinatorConfig.MaxSelectPointN, + Flag: "influxql-max-select-point", + Desc: "The maximum number of points a SELECT can process. A value of 0 will make the maximum point count unlimited. This will only be checked every second so queries will not be aborted immediately when hitting the limit.", + }, + { + DestP: &l.CoordinatorConfig.MaxSelectSeriesN, + Flag: "influxql-max-select-series", + Desc: "The maximum number of series a SELECT can run. A value of 0 will make the maximum series count unlimited.", + }, + { + DestP: &l.CoordinatorConfig.MaxSelectBucketsN, + Flag: "influxql-max-select-buckets", + Desc: "The maximum number of group by time bucket a SELECT can create. A value of zero will max the maximum number of buckets unlimited.", + }, } } @@ -478,6 +495,9 @@ type Launcher struct { engine Engine StorageConfig storage.Config + // InfluxQL query engine + CoordinatorConfig iqlcoordinator.Config + queryController *control.Controller httpPort int @@ -920,12 +940,20 @@ func (m *Launcher) run(ctx context.Context) (err error) { DBRP: dbrpSvc, } + m.log.Info("Configuring InfluxQL statement executor (zeros indicate unlimited).", + zap.Int("max_select_point", m.CoordinatorConfig.MaxSelectPointN), + zap.Int("max_select_series", m.CoordinatorConfig.MaxSelectSeriesN), + zap.Int("max_select_buckets", m.CoordinatorConfig.MaxSelectBucketsN)) + qe := iqlquery.NewExecutor(m.log, cm) se := &iqlcoordinator.StatementExecutor{ - MetaClient: metaClient, - TSDBStore: m.engine.TSDBStore(), - ShardMapper: mapper, - DBRP: dbrpSvc, + MetaClient: metaClient, + TSDBStore: m.engine.TSDBStore(), + ShardMapper: mapper, + DBRP: dbrpSvc, + MaxSelectPointN: m.CoordinatorConfig.MaxSelectPointN, + MaxSelectSeriesN: m.CoordinatorConfig.MaxSelectSeriesN, + MaxSelectBucketsN: m.CoordinatorConfig.MaxSelectBucketsN, } qe.StatementExecutor = se qe.StatementNormalizer = se From 0fbbf76715aeea2520a7f7698be8789cbd18f7eb Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Fri, 4 Sep 2020 15:27:23 -0700 Subject: [PATCH 2/2] chore: Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de06f9c8523..4a3c503d664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ need to update any InfluxDB CLI config profiles with the new port number. 1. [19402](https://github.com/influxdata/influxdb/pull/19402): Inject Task's LatestSuccess Timestamp In Flux Extern 1. [19433](https://github.com/influxdata/influxdb/pull/19433): Add option to dump raw query results in CLI 1. [19506](https://github.com/influxdata/influxdb/pull/19506): Add TSM 1.x storage options as flags +1. [19508](https://github.com/influxdata/influxdb/pull/19508): Add subset of InfluxQL coordinator options as flags ### Bug Fixes