Skip to content

Commit 7440d5f

Browse files
committed
fix: resolve broken wal tests
1 parent 75af6bd commit 7440d5f

4 files changed

Lines changed: 11 additions & 20 deletions

File tree

src/common/meta/src/wal_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl WalProvider {
7474
}
7575

7676
/// Allocates a batch of wal options where each wal options goes to a region.
77-
/// If skip_wal is true, the wal options will be set to Noop regardless of the provider type.
77+
/// skip_wal does not affect provider allocation.
7878
pub fn alloc_batch(&self, num_regions: usize, _skip_wal: bool) -> Result<Vec<WalOptions>> {
7979
match self {
8080
WalProvider::RaftEngine => Ok(vec![WalOptions::RaftEngine; num_regions]),

src/mito2/src/engine/alter_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ async fn test_alter_region_enable_wal_on_legacy_noop_region_fails() {
20272027
.await
20282028
.unwrap_err();
20292029

2030-
let msg = err.to_string();
2030+
let msg = err.output_msg();
20312031

20322032
assert!(
20332033
msg.contains("Cannot enable WAL for legacy regions with noop wal_options"),

src/table/src/metadata.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,16 +1619,12 @@ mod tests {
16191619
.build()
16201620
.unwrap();
16211621

1622+
assert!(new_meta.options.skip_wal);
1623+
16221624
assert_eq!(
1623-
Some("true"),
1624-
new_meta
1625-
.options
1626-
.extra_options
1627-
.get(SKIP_WAL_KEY)
1628-
.map(String::as_str)
1625+
Some(&"true".to_string()),
1626+
HashMap::from(&new_meta.options).get(SKIP_WAL_KEY)
16291627
);
1630-
1631-
assert!(new_meta.options.skip_wal);
16321628
}
16331629

16341630
#[test]
@@ -1653,16 +1649,12 @@ mod tests {
16531649
.build()
16541650
.unwrap();
16551651

1652+
assert!(!new_meta.options.skip_wal);
1653+
16561654
assert_eq!(
1657-
Some("false"),
1658-
new_meta
1659-
.options
1660-
.extra_options
1661-
.get(SKIP_WAL_KEY)
1662-
.map(String::as_str)
1655+
Some(&"false".to_string()),
1656+
HashMap::from(&new_meta.options).get(SKIP_WAL_KEY)
16631657
);
1664-
1665-
assert!(!new_meta.options.skip_wal);
16661658
}
16671659

16681660
#[test]

src/table/src/requests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use store_api::mito_engine_options::{
4040
TWCS_FALLBACK_TO_LOCAL, TWCS_MAX_OUTPUT_FILE_SIZE, TWCS_TIME_WINDOW, TWCS_TRIGGER_FILE_NUM,
4141
is_mito_engine_option_key,
4242
};
43-
use store_api::path_utils::WAL_DIR;
4443
use store_api::region_request::{SetRegionOption, UnsetRegionOption};
4544

4645
use crate::error::{ParseTableOptionSnafu, Result};
@@ -193,7 +192,7 @@ impl TableOptions {
193192

194193
options.extra_options = HashMap::from_iter(
195194
kvs.into_iter()
196-
.filter(|(k, _)| k != WRITE_BUFFER_SIZE_KEY && k != TTL_KEY),
195+
.filter(|(k, _)| k != WRITE_BUFFER_SIZE_KEY && k != TTL_KEY && k != SKIP_WAL_KEY),
197196
);
198197

199198
Ok(options)

0 commit comments

Comments
 (0)