From 7ee54b3e6985e11f7b13f707f797adc72b16d6ee Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Tue, 14 Mar 2023 11:09:58 +0800 Subject: [PATCH] fix: don't skip wal in test --- src/storage/src/region/writer.rs | 14 +++++--------- src/storage/src/wal.rs | 3 +++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/storage/src/region/writer.rs b/src/storage/src/region/writer.rs index c042eb7585..cc4e5d3126 100644 --- a/src/storage/src/region/writer.rs +++ b/src/storage/src/region/writer.rs @@ -376,15 +376,11 @@ impl WriterInner { let version = version_control.current(); - let region_id = writer_ctx.shared.id; - // table with id less than MIN_USER_TABLE_ID is system table - if (region_id >> 32) < 1024 { - let wal_header = WalHeader::with_last_manifest_version(version.manifest_version()); - writer_ctx - .wal - .write_to_wal(next_sequence, wal_header, Some(request.payload())) - .await?; - } + let wal_header = WalHeader::with_last_manifest_version(version.manifest_version()); + writer_ctx + .wal + .write_to_wal(next_sequence, wal_header, Some(request.payload())) + .await?; // Insert batch into memtable. let mut inserter = Inserter::new(next_sequence); diff --git a/src/storage/src/wal.rs b/src/storage/src/wal.rs index fa415bd3db..fc709e04cc 100644 --- a/src/storage/src/wal.rs +++ b/src/storage/src/wal.rs @@ -106,6 +106,9 @@ impl Wal { mut header: WalHeader, payload: Option<&Payload>, ) -> Result { + if !cfg!(test) && (self.region_id >> 32) >= 1024 { + return Ok(seq); + } if let Some(p) = payload { header.mutation_types = wal::gen_mutation_types(p); }