diff --git a/compactor/src/handler.rs b/compactor/src/handler.rs index 2deb2df819..f10fb89d27 100644 --- a/compactor/src/handler.rs +++ b/compactor/src/handler.rs @@ -5,7 +5,7 @@ use backoff::{Backoff, BackoffConfig}; use data_types2::SequencerId; use futures::{ future::{BoxFuture, Shared}, - FutureExt, TryFutureExt, + select, FutureExt, TryFutureExt, }; use iox_catalog::interface::Catalog; use iox_time::TimeProvider; @@ -198,9 +198,13 @@ async fn run_compactor(compactor: Arc, shutdown: CancellationToken) { let _ = futures::future::join_all(handles).await; - // if all candidate partitions have been compacted, wait a bit before checking again + // if all candidate partitions have been compacted, wait a bit + // before checking again, but don'skip sleeping if cancel arrives if compactions_run == n_candidates { - tokio::time::sleep(Duration::from_secs(5)).await; + select! { + () = tokio::time::sleep(Duration::from_secs(5)).fuse() => {}, + () = shutdown.cancelled().fuse() => {} + } } } } diff --git a/influxdb_iox/src/commands/run/all_in_one.rs b/influxdb_iox/src/commands/run/all_in_one.rs index 1d1007bd61..58fca31f2e 100644 --- a/influxdb_iox/src/commands/run/all_in_one.rs +++ b/influxdb_iox/src/commands/run/all_in_one.rs @@ -228,6 +228,8 @@ pub struct Config { /// The address on which IOx will serve Router HTTP API requests #[clap( long = "--router-http-bind", + // by default, write API requests go to router + alias = "api-bind", env = "INFLUXDB_IOX_ROUTER_HTTP_BIND_ADDR", default_value = DEFAULT_ROUTER_HTTP_BIND_ADDR, )] @@ -244,6 +246,8 @@ pub struct Config { /// The address on which IOx will serve Querier gRPC API requests #[clap( long = "--querier-grpc-bind", + // by default, grpc requests go to querier + alias = "grpc-bind", env = "INFLUXDB_IOX_QUERIER_GRPC_BIND_ADDR", default_value = DEFAULT_QUERIER_GRPC_BIND_ADDR, )] diff --git a/ioxd_compactor/src/lib.rs b/ioxd_compactor/src/lib.rs index 47a659ae8b..ef2a038a36 100644 --- a/ioxd_compactor/src/lib.rs +++ b/ioxd_compactor/src/lib.rs @@ -85,7 +85,6 @@ impl ServerType for CompactorSe /// Provide a placeholder gRPC service. async fn server_grpc(self: Arc, builder_input: RpcBuilderInput) -> Result<(), RpcError> { let builder = setup_builder!(builder_input, self); - // TODO add a service here serve_builder!(builder); Ok(())