8000 feat: print backtrace in pg_protocol in debug mode by xxchan · Pull Request #21756 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: print backtrace in pg_protocol in debug mode #21756

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ otlp-embedded = { git = "https://github.com/risingwavelabs/otlp-embedded", rev =
prost = { version = "0.13" }
prost-build = { version = "0.13" }
# branch dev_rebase_main_20250325
iceberg = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "9c210b9", features = [
iceberg = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "53e8240e", features = [
"storage-s3",
"storage-gcs",
"storage-azblob",
] }
iceberg-catalog-rest = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "9c210b9" }
iceberg-catalog-glue = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "9c210b9" }
iceberg-catalog-rest = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "53e8240e" }
iceberg-catalog-glue = { git = "https://github.com/risingwavelabs/iceberg-rust.git", rev = "53e8240e" }
opendal = "0.49"
arrow-udf-runtime = "0.7.0"
clap = { version = "4", features = ["cargo", "derive", "env"] }
Expand Down
12 changes: 8 additions & 4 deletions ci/scripts/e2e-iceberg-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ PGPASSWORD=postgres psql -h db -p 5432 -U postgres -c "DROP DATABASE IF EXISTS m
risedev ci-start ci-iceberg-test


unset BUILDKITE_PARALLEL_JOB
unset BUILDKITE_PARALLEL_JOB_COUNT


echo "--- Running tests"
cd e2e_test/iceberg
# Don't remove the `--quiet` option since poetry has a bug when printing output, see
# https://github.com/python-poetry/poetry/issues/3412
poetry update --quiet
poetry run python main.py

echo "--- Running pure slt tests"
risedev slt './e2e_test/iceberg/test_case/pure_slt/*.slt'
# echo "--- Running pure slt tests"
# risedev slt './e2e_test/iceberg/test_case/pure_slt/*.slt'

# Run benchmarks separately (not parallelized)
echo "--- Running benchmarks"
poetry run python main.py -t ./benches/predicate_pushdown.toml
# echo "--- Running benchmarks"
# poetry run python main.py -t ./benches/predicate_pushdown.toml
2 changes: 1 addition & 1 deletion ci/workflows/main-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ steps:
run: iceberg-test-env
- ./ci/plugins/upload-failure-logs
timeout_in_minutes: 15
parallelism: 2
parallelism: 40
retry: *auto-retry

- label: "e2e java-binding test (release)"
Expand Down
2 changes: 1 addition & 1 deletion ci/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ steps:
run: iceberg-test-env
- ./ci/plugins/upload-failure-logs
timeout_in_minutes: 22
parallelism: 2
parallelism: 40
retry: *auto-retry

- label: "end-to-end pulsar sink test"
Expand Down
6 changes: 1 addition & 5 deletions e2e_test/iceberg/test_utils/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ def print_test_summary(results: List[TestResult]):

# Print individual test results
for result in results:
status = (
Color.GREEN + "PASSED" + Color.ENDC
if result.success
else Color.RED + "FAILED" + Color.ENDC
)
status = "PASSED" if result.success else "FAILED"
duration_str = f"{result.duration.total_seconds():.2f}s"
log(
f"{result.name}: {status} ({duration_str})",
Expand Down
20 changes: 13 additions & 7 deletions src/common/src/util/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::sync::LazyLock;

use enum_as_inner::EnumAsInner;

use super::env_var::env_var_is_true;
Expand All @@ -31,12 +33,16 @@ pub enum Deployment {
impl Deployment {
/// Returns the deployment environment detected from current environment variables.
pub fn current() -> Self {
if env_var_is_true("RISINGWAVE_CI") {
Self::Ci
} else if env_var_is_true("RISINGWAVE_CLOUD") {
Self::Cloud
} else {
Self::Other
}
*CURRENT_DEPLOYMENT
}
}

static CURRENT_DEPLOYMENT: LazyLock<Deployment> = LazyLock::new(|| {
if env_var_is_true("RISINGWAVE_CI") {
Deployment::Ci
} else if env_var_is_true("RISINGWAVE_CLOUD") {
Deployment::Cloud
} else {
Deployment::Other
}
});
17 changes: 13 additions & 4 deletions src/connector/src/source/iceberg/mod.rs
F438
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod metrics;
use std::collections::{BinaryHeap, HashMap, HashSet};
use std::sync::Arc;

use anyhow::anyhow;
use anyhow::{Context, anyhow};
use async_trait::async_trait;
use futures::StreamExt;
use futures_async_stream::{for_await, try_stream};
Expand Down Expand Up @@ -398,7 +398,10 @@ impl IcebergSplitEnumerator {
.build()
.map_err(|e| anyhow!(e))?;

let file_scan_stream = scan.plan_files().await.map_err(|e| anyhow!(e))?;
let file_scan_stream = scan
.plan_files()
.await
.context("failed to plan files in list_splits_batch_scan")?;

#[for_await]
for task in file_scan_stream {
Expand Down Expand Up @@ -476,7 +479,10 @@ impl IcebergSplitEnumerator {
.with_delete_file_processing_enabled(true)
.build()
.map_err(|e| anyhow!(e))?;
let file_scan_stream = scan.plan_files().await.map_err(|e| anyhow!(e))?;
let file_scan_stream = scan
.plan_files()
.await
.context("failed to plan files in list_splits_batch_count_star")?;

#[for_await]
for task in file_scan_stream {
Expand Down Expand Up @@ -504,7 +510,10 @@ impl IcebergSplitEnumerator {
.with_delete_file_processing_enabled(true)
.build()
.map_err(|e| anyhow!(e))?;
let file_scan_stream = scan.plan_files().await.map_err(|e| anyhow!(e))?;
let file_scan_stream = scan
.plan_files()
.await
.context("failed to plan files in all_delete_parameters")?;
let schema = scan.snapshot().schema(table.metadata())?;
let mut equality_ids = vec![];
let mut have_position_delete = false;
Expand Down
14 changes: 13 additions & 1 deletion src/utils/pgwire/src/pg_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,19 @@ where
// Note: all messages will be processed through this code path, making it the
// only necessary place to log errors.
if let Err(error) = &result {
tracing::error!(error = %error.as_report(), "error when process message");
use risingwave_common::util::deployment::Deployment;
if cfg!(debug_assertions) {
// Print backtrace in debug mode.
// Print it here is the last resort.
// It's useful only when:
// - no additional context is added to the error
// - backtrace is captured in the error
// - backtrace is not printed in the middle
tracing::error!(error = ?error.as_report(), "error when process message");
tracing::error!(error = ?error, "Debug error");
} else {
tracing::error!(error = %error.as_report(), "error when process message");
}
}

// Log to optionally-enabled target `PGWIRE_QUERY_LOG`.
Expand Down
Loading
0