Skip to content

Commit

Permalink
fix: show progress for background ddls that are in initial status (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
yezizp2012 authored Aug 14, 2024
1 parent ebc0e47 commit a1872f3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
4 changes: 1 addition & 3 deletions ci/scripts/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ echo "--- e2e, $mode, batch"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info" \
cluster_start
sqllogictest -p 4566 -d dev './e2e_test/ddl/**/*.slt' --junit "batch-ddl-${profile}" --label "can-use-recover"
if [[ "$mode" != "single-node" ]]; then
sqllogictest -p 4566 -d dev './e2e_test/background_ddl/basic.slt' --junit "batch-ddl-${profile}"
fi
sqllogictest -p 4566 -d dev './e2e_test/background_ddl/basic.slt' --junit "batch-ddl-${profile}"

if [[ $mode != "single-node" ]]; then
sqllogictest -p 4566 -d dev './e2e_test/visibility_mode/*.slt' --junit "batch-${profile}"
Expand Down
3 changes: 3 additions & 0 deletions e2e_test/streaming/union.slt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ Caused by:
Invalid input syntax: When CORRESPONDING is specified, at least one column of the left side shall have a column name that is the column name of some column of the right side in a UNION operation. Left side query column list: ("v1", "v2", "v4"). Right side query column list: ("vxx").


statement ok
drop table txx;

statement ok
drop table t1;

Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/barrier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ impl GlobalBarrierManagerContext {
MetadataManager::V2(mgr) => {
let mviews = mgr
.catalog_controller
.list_background_creating_mviews()
.list_background_creating_mviews(true)
.await
.unwrap();
for mview in mviews {
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/barrier/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl GlobalBarrierManagerContext {
let mgr = self.metadata_manager.as_v2_ref();
let mviews = mgr
.catalog_controller
.list_background_creating_mviews()
.list_background_creating_mviews(false)
.await?;

let mut mview_map = HashMap::new();
Expand Down
12 changes: 10 additions & 2 deletions src/meta/src/controller/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,16 @@ impl CatalogController {
Ok(())
}

pub async fn list_background_creating_mviews(&self) -> MetaResult<Vec<table::Model>> {
pub async fn list_background_creating_mviews(
&self,
include_initial: bool,
) -> MetaResult<Vec<table::Model>> {
let inner = self.inner.read().await;
let status_cond = if include_initial {
streaming_job::Column::JobStatus.is_in([JobStatus::Initial, JobStatus::Creating])
} else {
streaming_job::Column::JobStatus.eq(JobStatus::Creating)
};
let tables = Table::find()
.join(JoinType::LeftJoin, table::Relation::Object1.def())
.join(JoinType::LeftJoin, object::Relation::StreamingJob.def())
Expand All @@ -554,7 +562,7 @@ impl CatalogController {
.and(
streaming_job::Column::CreateType
.eq(CreateType::Background)
.and(streaming_job::Column::JobStatus.eq(JobStatus::Creating)),
.and(status_cond),
),
)
.all(&inner.db)
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/manager/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ impl MetadataManager {
MetadataManager::V2(mgr) => {
let tables = mgr
.catalog_controller
.list_background_creating_mviews()
.list_background_creating_mviews(false)
.await?;

Ok(tables
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/rpc/ddl_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ impl DdlController {
MetadataManager::V2(mgr) => {
if mgr
.catalog_controller
.list_background_creating_mviews()
.list_background_creating_mviews(true)
.await?
.is_empty()
{
Expand Down

0 comments on commit a1872f3

Please sign in to comment.