Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(meta): Add creating_status field for stream jobs #12330

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions proto/catalog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ message Table {
INTERNAL = 4;
}

enum TableStatus {
// Prefixed by `TABLE_STATUS` due to protobuf namespacing rules.
TABLE_STATUS_UNSPECIFIED = 0;
CREATING = 1;
CREATED = 2;
}

message TableVersion {
// The version number, which will be 0 by default and be increased by 1 for
// each schema change in the frontend.
Expand Down Expand Up @@ -250,6 +257,9 @@ message Table {
// In older versions we can just initialize without it.
bool cleaned_by_watermark = 30;

// Used to filter created / creating tables in meta.
TableStatus create_status = 31;
kwannoel marked this conversation as resolved.
Show resolved Hide resolved

// Per-table catalog version, used by schema change. `None` for internal tables and tests.
// Not to be confused with the global catalog version for notification service.
TableVersion version = 100;
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/src/catalog/table_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use risingwave_common::constants::hummock::TABLE_OPTION_DUMMY_RETENTION_SECOND;
use risingwave_common::error::{ErrorCode, RwError};
use risingwave_common::util::epoch::Epoch;
use risingwave_common::util::sort_util::ColumnOrder;
use risingwave_pb::catalog::table::{OptionalAssociatedSourceId, PbTableType, PbTableVersion};
use risingwave_pb::catalog::table::{
OptionalAssociatedSourceId, PbTableStatus, PbTableType, PbTableVersion,
};
use risingwave_pb::catalog::PbTable;
use risingwave_pb::plan_common::column_desc::GeneratedOrDefaultColumn;
use risingwave_pb::plan_common::DefaultColumnDesc;
Expand Down Expand Up @@ -401,6 +403,7 @@ impl TableCatalog {
initialized_at_epoch: self.initialized_at_epoch.map(|epoch| epoch.0),
created_at_epoch: self.created_at_epoch.map(|epoch| epoch.0),
cleaned_by_watermark: self.cleaned_by_watermark,
create_status: PbTableStatus::Creating.into(),
kwannoel marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down Expand Up @@ -542,6 +545,7 @@ mod tests {
use risingwave_common::test_prelude::*;
use risingwave_common::types::*;
use risingwave_common::util::sort_util::OrderType;
use risingwave_pb::catalog::table::PbTableStatus;
use risingwave_pb::catalog::PbTable;
use risingwave_pb::plan_common::{PbColumnCatalog, PbColumnDesc};

Expand Down Expand Up @@ -605,6 +609,7 @@ mod tests {
cardinality: None,
created_at_epoch: None,
cleaned_by_watermark: false,
create_status: PbTableStatus::Creating.into(),
}
.into();

Expand Down
3 changes: 2 additions & 1 deletion src/storage/src/filter_key_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ mod tests {
use risingwave_common::util::row_serde::OrderedRowSerde;
use risingwave_common::util::sort_util::OrderType;
use risingwave_hummock_sdk::key::TABLE_PREFIX_LEN;
use risingwave_pb::catalog::table::TableType;
use risingwave_pb::catalog::table::{PbTableStatus, TableType};
use risingwave_pb::catalog::PbTable;
use risingwave_pb::common::{PbColumnOrder, PbDirection, PbNullsAre, PbOrderType};
use risingwave_pb::plan_common::PbColumnCatalog;
Expand Down Expand Up @@ -549,6 +549,7 @@ mod tests {
cardinality: None,
created_at_epoch: None,
cleaned_by_watermark: false,
create_status: PbTableStatus::Creating.into(),
kwannoel marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/tests/compaction_test/src/delete_range_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use risingwave_meta::hummock::test_utils::setup_compute_env_with_config;
use risingwave_meta::hummock::MockHummockMetaClient;
use risingwave_object_store::object::object_metrics::ObjectStoreMetrics;
use risingwave_object_store::object::parse_remote_object_store;
use risingwave_pb::catalog::table::PbTableStatus;
use risingwave_pb::catalog::PbTable;
use risingwave_pb::hummock::{CompactionConfig, CompactionGroupInfo};
use risingwave_pb::meta::SystemParams;
Expand Down Expand Up @@ -150,6 +151,7 @@ async fn compaction_test(
cardinality: None,
created_at_epoch: None,
cleaned_by_watermark: false,
create_status: PbTableStatus::Creating.into(),
kwannoel marked this conversation as resolved.
Show resolved Hide resolved
};
let mut delete_range_table = delete_key_table.clone();
delete_range_table.id = 2;
Expand Down
Loading