Skip to content

Commit

Permalink
backtrace for storage error
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Dec 1, 2023
1 parent 183191f commit 10b974e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
8 changes: 2 additions & 6 deletions src/jni_core/src/hummock_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use risingwave_object_store::object::build_remote_object_store;
use risingwave_object_store::object::object_metrics::ObjectStoreMetrics;
use risingwave_pb::java_binding::key_range::Bound;
use risingwave_pb::java_binding::{KeyRange, ReadPlan};
use risingwave_storage::error::{StorageError, StorageResult};
use risingwave_storage::error::StorageResult;
use risingwave_storage::hummock::local_version::pinned_version::PinnedVersion;
use risingwave_storage::hummock::store::version::HummockVersionReader;
use risingwave_storage::hummock::store::HummockStorageIterator;
Expand Down Expand Up @@ -135,11 +135,7 @@ impl HummockJavaBindingIterator {
Ok(match item {
Some((key, value)) => Some((
key.user_key.table_key.0,
OwnedRow::new(
self.row_serde
.deserialize(&value)
.map_err(StorageError::DeserializeRow)?,
),
OwnedRow::new(self.row_serde.deserialize(&value)?),
)),
None => None,
})
Expand Down
9 changes: 0 additions & 9 deletions src/meta/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::sync::Arc;

use aws_sdk_ec2::error::DisplayErrorContext;
use risingwave_common::error::BoxedError;
use risingwave_connector::sink::SinkError;
Expand Down Expand Up @@ -100,13 +98,6 @@ pub enum MetaErrorInner {
#[error("AWS SDK error: {}", DisplayErrorContext(& * *.0))]
Aws(#[source] BoxedError),

#[error(transparent)]
Shared(
#[from]
#[backtrace]
Arc<MetaError>,
),

#[error(transparent)]
Internal(
#[from]
Expand Down
5 changes: 3 additions & 2 deletions src/storage/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ use thiserror::Error;
use crate::hummock::HummockError;
use crate::mem_table::MemTableError;

#[derive(Error, Debug)]
pub enum StorageError {
#[derive(Error, Debug, thiserror_ext::Box)]
#[thiserror_ext(newtype(name = StorageError, backtrace, report_debug))]
pub enum ErrorKind {
#[error("Hummock error: {0}")]
Hummock(
#[backtrace]
Expand Down
6 changes: 3 additions & 3 deletions src/stream/src/common/table/state_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use risingwave_hummock_sdk::key::{
start_bound_of_excluded_prefix, TableKey,
};
use risingwave_pb::catalog::Table;
use risingwave_storage::error::{StorageError, StorageResult};
use risingwave_storage::error::{ErrorKind, StorageError, StorageResult};
use risingwave_storage::hummock::CachePolicy;
use risingwave_storage::mem_table::MemTableError;
use risingwave_storage::row_serde::row_serde_util::{
Expand Down Expand Up @@ -689,8 +689,8 @@ where
SD: ValueRowSerde,
{
fn handle_mem_table_error(&self, e: StorageError) {
let e = match e {
StorageError::MemTable(e) => e,
let e = match e.into_inner() {
ErrorKind::MemTable(e) => e,
_ => unreachable!("should only get memtable error"),
};
match *e {
Expand Down

0 comments on commit 10b974e

Please sign in to comment.