refactor(iox): lower default table limit

Drops the default table limit from 10,000 to 500. This will apply to all
new namespaces / org&bucket created after this change has been deployed.
pull/24376/head
Dom Dwyer 2023-02-03 16:25:15 +01:00
parent 1535366666
commit 2af563ad94
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,7 @@ const SHARED_QUERY_POOL: &str = SHARED_TOPIC_NAME;
const TIME_COLUMN: &str = "time";
/// Default per-namespace table count service protection limit.
pub const DEFAULT_MAX_TABLES: i32 = 10_000;
pub const DEFAULT_MAX_TABLES: i32 = 500;
/// Default per-table column count service protection limit.
pub const DEFAULT_MAX_COLUMNS_PER_TABLE: i32 = 200;
/// Default retention period for data in the catalog.

View File

@ -632,15 +632,16 @@ impl NamespaceRepo for PostgresTxn {
) -> Result<Namespace> {
let rec = sqlx::query_as::<_, Namespace>(
r#"
INSERT INTO namespace ( name, topic_id, query_pool_id, retention_period_ns )
VALUES ( $1, $2, $3, $4 )
INSERT INTO namespace ( name, topic_id, query_pool_id, retention_period_ns, max_tables )
VALUES ( $1, $2, $3, $4, $5 )
RETURNING *;
"#,
)
.bind(name) // $1
.bind(topic_id) // $2
.bind(query_pool_id) // $3
.bind(retention_period_ns); // $4
.bind(retention_period_ns) // $4
.bind(DEFAULT_MAX_TABLES); // $5
let rec = rec.fetch_one(&mut self.inner).await.map_err(|e| {
if is_unique_violation(&e) {