Skip to content

Commit

Permalink
add config for easy of testing
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Mar 12, 2024
1 parent 55fde18 commit 2285c1f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ if ${is_not_ci}
no_rust_log = not ${rust_log}
if ${no_rust_log}
set_env RUST_LOG "pgwire_query_log=info"
set_env RUST_LOG "pgwire_query_log=info,hyper::client::connect::http=info"
else
set_env RUST_LOG "pgwire_query_log=info,${rust_log}"
set_env RUST_LOG "pgwire_query_log=info,hyper::client::connect::http=info,${rust_log}"
end
end
''',
Expand Down
2 changes: 2 additions & 0 deletions src/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#![feature(bound_map)]
#![feature(array_methods)]
#![feature(btree_cursors)]
#![feature(register_tool)]
#![register_tool(rw)]

#[cfg_attr(not(test), allow(unused_extern_crates))]
extern crate self as risingwave_common;
Expand Down
4 changes: 4 additions & 0 deletions src/common/src/session_config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ pub struct ConfigMap {
#[parameter(default = false)]
background_ddl: bool,

/// Run DDL statements in background
#[parameter(default = false)]
enable_reusable_source: bool,

/// Shows the server-side character set encoding. At present, this parameter can be shown but not set, because the encoding is determined at database creation time.
#[parameter(default = SERVER_ENCODING)]
server_encoding: String,
Expand Down
3 changes: 2 additions & 1 deletion src/common/src/system_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ macro_rules! impl_set_system_param {
$(
key_of!($field) => {
let v = if let Some(v) = value {
v.as_ref().parse().map_err(|_| format!("cannot parse parameter value"))?
#[allow(rw::format_error)]
v.as_ref().parse().map_err(|e| format!("cannot parse parameter value: {e}"))?
} else {
$default.ok_or_else(|| format!("{} does not have a default value", key))?
};
Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/source/kafka/private_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ impl BrokerAddrRewriter {
role: PrivateLinkContextRole,
broker_rewrite_map: Option<HashMap<String, String>>,
) -> ConnectorResult<Self> {
tracing::info!("[{}] rewrite map {:?}", role, broker_rewrite_map);
let rewrite_map: ConnectorResult<BTreeMap<BrokerAddr, BrokerAddr>> = broker_rewrite_map
.map_or(Ok(BTreeMap::new()), |addr_map| {
tracing::info!("[{}] rewrite map {:?}", role, addr_map);
addr_map
.into_iter()
.map(|(old_addr, new_addr)| {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/handler/create_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ pub async fn handle_create_source(

let catalog_writer = session.catalog_writer()?;

if has_streaming_job {
if has_streaming_job && session.config().enable_reusable_source() {
let graph = {
let context = OptimizerContext::from_handler_args(handler_args);
let source_node = LogicalSource::with_catalog(
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/src/planner/relation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ impl Planner {
"Should not create MATERIALIZED VIEW directly on shared CDC source. HINT: create TABLE from the source instead.".to_string(),
)
.into())
} else if source.can_backfill() {
} else if source.can_backfill()
&& self.ctx().session_ctx().config().enable_reusable_source()
{
Ok(LogicalSourceBackfill::new(Rc::new(source.catalog), self.ctx())?.into())
} else {
Ok(LogicalSource::with_catalog(
Expand Down

0 comments on commit 2285c1f

Please sign in to comment.