Skip to content

Commit 261f0d1

Browse files
authored
refactor(query): remove background service (#17659)
* refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service * refactor(query): remove background service
1 parent 8de2a23 commit 261f0d1

File tree

77 files changed

+6
-6161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6
-6161
lines changed

.github/actions/test_ee_standalone_background_linux/action.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/reuse.linux.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,24 +263,6 @@ jobs:
263263
with:
264264
name: test-stateful-standalone-linux
265265

266-
test_ee_standalone_background:
267-
needs: [build, check]
268-
runs-on: [self-hosted, X64, Linux, 2c8g, "${{ inputs.runner_provider }}"]
269-
steps:
270-
- uses: actions/checkout@v4
271-
- uses: ./.github/actions/setup_bendsql
272-
- uses: ./.github/actions/setup_license
273-
with:
274-
runner_provider: ${{ inputs.runner_provider }}
275-
type: ${{ inputs.license_type }}
276-
- uses: ./.github/actions/test_ee_standalone_background_linux
277-
timeout-minutes: 10
278-
- name: Upload failure
279-
if: failure()
280-
uses: ./.github/actions/artifact_failure
281-
with:
282-
name: test-stateful-standalone-linux
283-
284266
# Temporarily commented out, since this job is run on self-hosted, may
285267
# bring troubles to other jobs run on self-hosted.
286268
#

Cargo.lock

Lines changed: 0 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ members = [
7878
"src/query/users",
7979
"src/query/ee_features/attach_table",
8080
"src/query/ee_features/vacuum_handler",
81-
"src/query/ee_features/background_service",
8281
"src/query/ee_features/aggregating_index",
8382
"src/query/ee_features/data_mask",
8483
"src/query/ee_features/storage_encryption",
@@ -186,7 +185,6 @@ databend-common-users = { path = "src/query/users" }
186185
databend-common-vector = { path = "src/common/vector" }
187186
databend-enterprise-aggregating-index = { path = "src/query/ee_features/aggregating_index" }
188187
databend-enterprise-attach-table = { path = "src/query/ee_features/attach_table" }
189-
databend-enterprise-background-service = { path = "src/query/ee_features/background_service" }
190188
databend-enterprise-data-mask-feature = { path = "src/query/ee_features/data_mask" }
191189
databend-enterprise-fail-safe = { path = "src/query/ee_features/fail_safe" }
192190
databend-enterprise-hilbert-clustering = { path = "src/query/ee_features/hilbert_clustering" }

scripts/ci/ci-run-ee-tests-standalone-minio-background.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/binaries/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ databend-common-meta-client = { workspace = true }
3030
databend-common-metrics = { workspace = true }
3131
databend-common-storage = { workspace = true }
3232
databend-common-tracing = { workspace = true }
33-
databend-enterprise-background-service = { workspace = true }
3433
databend-enterprise-query = { workspace = true }
3534
databend-query = { workspace = true }
3635
databend-storages-common-table-meta = { workspace = true }

src/binaries/query/entry.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use databend_common_meta_client::MIN_METASRV_SEMVER;
3131
use databend_common_metrics::system::set_system_version;
3232
use databend_common_storage::DataOperator;
3333
use databend_common_tracing::set_panic_hook;
34-
use databend_enterprise_background_service::get_background_service_handler;
3534
use databend_query::clusters::ClusterDiscovery;
3635
use databend_query::local;
3736
use databend_query::servers::admin::AdminService;
@@ -414,21 +413,11 @@ pub async fn start_services(conf: &InnerConfig) -> Result<(), MainError> {
414413
start_time.elapsed().as_secs_f32()
415414
);
416415

417-
if conf.background.enable {
418-
println!("Start background service");
419-
get_background_service_handler()
420-
.start()
421-
.await
422-
.with_context(make_error)?;
423-
// for one shot background service, we need to drop it manually.
424-
drop(shutdown_handle);
425-
} else {
426-
let graceful_shutdown_timeout =
427-
Some(Duration::from_millis(conf.query.shutdown_wait_timeout_ms));
428-
shutdown_handle
429-
.wait_for_termination_request(graceful_shutdown_timeout)
430-
.await;
431-
}
416+
let graceful_shutdown_timeout =
417+
Some(Duration::from_millis(conf.query.shutdown_wait_timeout_ms));
418+
shutdown_handle
419+
.wait_for_termination_request(graceful_shutdown_timeout)
420+
.await;
432421
info!("Shutdown server.");
433422
log::logger().flush();
434423
Ok(())

src/common/exception/src/exception_code.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ build_exceptions! {
198198
EnterpriseFeatureNotEnable(1403),
199199
LicenseKeyExpired(1404),
200200

201-
BackgroundJobAlreadyExists(1501),
202-
UnknownBackgroundJob(1502),
203-
204201
InvalidRowIdIndex(1503),
205202
// Index related errors.
206203
UnsupportedIndex(1601),

src/common/license/src/license.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ pub enum Feature {
5151
Test,
5252
#[serde(alias = "virtual_column", alias = "VIRTUAL_COLUMN")]
5353
VirtualColumn,
54-
#[serde(alias = "background_service", alias = "BACKGROUND_SERVICE")]
55-
BackgroundService,
5654
#[serde(alias = "data_mask", alias = "DATA_MASK")]
5755
DataMask,
5856
#[serde(alias = "aggregate_index", alias = "AGGREGATE_INDEX")]
@@ -88,7 +86,6 @@ impl fmt::Display for Feature {
8886
Feature::Vacuum => write!(f, "vacuum"),
8987
Feature::Test => write!(f, "test"),
9088
Feature::VirtualColumn => write!(f, "virtual_column"),
91-
Feature::BackgroundService => write!(f, "background_service"),
9289
Feature::DataMask => write!(f, "data_mask"),
9390
Feature::AggregateIndex => write!(f, "aggregate_index"),
9491
Feature::InvertedIndex => write!(f, "inverted_index"),
@@ -167,7 +164,6 @@ impl Feature {
167164
| (Feature::Vacuum, Feature::Vacuum)
168165
| (Feature::LicenseInfo, Feature::LicenseInfo)
169166
| (Feature::Stream, Feature::Stream)
170-
| (Feature::BackgroundService, Feature::BackgroundService)
171167
| (Feature::DataMask, Feature::DataMask)
172168
| (Feature::InvertedIndex, Feature::InvertedIndex)
173169
| (Feature::VirtualColumn, Feature::VirtualColumn)
@@ -278,10 +274,6 @@ mod tests {
278274
Feature::VirtualColumn,
279275
serde_json::from_str::<Feature>("\"VIRTUAL_COLUMN\"").unwrap()
280276
);
281-
assert_eq!(
282-
Feature::BackgroundService,
283-
serde_json::from_str::<Feature>("\"BackgroundService\"").unwrap()
284-
);
285277
assert_eq!(
286278
Feature::DataMask,
287279
serde_json::from_str::<Feature>("\"DataMask\"").unwrap()
@@ -363,7 +355,6 @@ mod tests {
363355
Feature::Vacuum,
364356
Feature::Test,
365357
Feature::VirtualColumn,
366-
Feature::BackgroundService,
367358
Feature::DataMask,
368359
Feature::AggregateIndex,
369360
Feature::InvertedIndex,
@@ -384,7 +375,7 @@ mod tests {
384375
};
385376

386377
assert_eq!(
387-
"LicenseInfo{ type: enterprise, org: databend, tenants: [databend_tenant,foo], features: [aggregate_index,amend_table,attach_table,background_service,compute_quota(threads_num: 1, memory_usage: 1),computed_column,data_mask,hilbert_clustering,inverted_index,license_info,storage_encryption,storage_quota(storage_usage: 1),stream,vacuum,virtual_column] }",
378+
"LicenseInfo{ type: enterprise, org: databend, tenants: [databend_tenant,foo], features: [aggregate_index,amend_table,attach_table,compute_quota(threads_num: 1, memory_usage: 1),computed_column,data_mask,hilbert_clustering,inverted_index,license_info,storage_encryption,storage_quota(storage_usage: 1),stream,vacuum,virtual_column] }",
388379
license_info.to_string()
389380
);
390381
}

src/meta/api/src/background_api.rs

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)