Skip to content

Commit

Permalink
fix: fix handler did not inject wal options
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 3, 2024
1 parent 94ea731 commit 2c17a94
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/datanode/src/heartbeat/handler/open_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use common_error::ext::ErrorExt;
use common_meta::instruction::{InstructionReply, OpenRegion, SimpleReply};
use common_meta::wal::prepare_wal_option;
use futures_util::future::BoxFuture;
use store_api::path_utils::region_dir;
use store_api::region_request::{RegionOpenRequest, RegionRequest};
Expand All @@ -26,26 +27,23 @@ impl HandlerContext {
OpenRegion {
region_ident,
region_storage_path,
region_options,
mut region_options,
region_wal_options,
skip_wal_replay,
}: OpenRegion,
) -> BoxFuture<'static, InstructionReply> {
Box::pin(async move {
let region_id = Self::region_ident_to_region_id(&region_ident);
// TODO(niebayes): extends region options with region_wal_options.
let _ = region_wal_options;
prepare_wal_option(&mut region_options, region_id, &region_wal_options);
let request = RegionRequest::Open(RegionOpenRequest {
engine: region_ident.engine,
region_dir: region_dir(&region_storage_path, region_id),
options: region_options,
skip_wal_replay,
});
let result = self.region_server.handle_request(region_id, request).await;

let success = result.is_ok();
let error = result.as_ref().map_err(|e| e.output_msg()).err();

InstructionReply::OpenRegion(SimpleReply {
result: success,
error,
Expand Down

0 comments on commit 2c17a94

Please sign in to comment.