This is an automated email from the ASF dual-hosted git repository.

jiacai2050 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-horaedb.git


The following commit(s) were added to refs/heads/dev by this push:
     new 2e900eaf chore: skip wal seq check when wal is disabled (#1430)
2e900eaf is described below

commit 2e900eaf6e6d3aaa954e7c70f5e723743ab699b7
Author: Jiacai Liu <[email protected]>
AuthorDate: Tue Jan 9 14:40:19 2024 +0800

    chore: skip wal seq check when wal is disabled (#1430)
    
    ## Rationale
    
    
    ## Detailed Changes
    - Disable seq check when wal is disabled
    - Fix request id in remote query.
    
    ## Test Plan
---
 analytic_engine/src/instance/write.rs        | 25 +++++++++++++------------
 server/src/grpc/remote_engine_service/mod.rs | 18 ++++++++++--------
 2 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/analytic_engine/src/instance/write.rs 
b/analytic_engine/src/instance/write.rs
index 2e5d60d0..244399c5 100644
--- a/analytic_engine/src/instance/write.rs
+++ b/analytic_engine/src/instance/write.rs
@@ -25,7 +25,6 @@ use codec::{
 use common_types::{
     row::RowGroup,
     schema::{IndexInWriterSchema, Schema},
-    MIN_SEQUENCE_NUMBER,
 };
 use itertools::Itertools;
 use logger::{debug, error, info, trace, warn};
@@ -529,17 +528,19 @@ impl<'a> Writer<'a> {
                 e
             })?;
 
-        // When seq is MIN_SEQUENCE_NUMBER, it means the wal used for write is 
not
-        // normal, ignore check in this case.
-        // NOTE: Currently write wal will only increment seq by one,
-        // this may change in future.
-        if sequence != MIN_SEQUENCE_NUMBER && table_data.last_sequence() + 1 
!= sequence {
-            warn!(
-                "Sequence must be consecutive, table:{}, table_id:{}, 
last_sequence:{}, wal_sequence:{}",
-                table_data.name,table_data.id,
-                table_data.last_sequence(),
-                sequence
-            );
+        // When wal is disabled, there is no need to do this check.
+        if !self.instance.disable_wal {
+            // NOTE: Currently write wal will only increment seq by one,
+            // this may change in future.
+            let last_seq = table_data.last_sequence();
+            if sequence != last_seq + 1 {
+                warn!(
+                    "Sequence must be consecutive, table:{}, table_id:{}, 
last_sequence:{}, wal_sequence:{}",
+                    table_data.name,table_data.id,
+                    table_data.last_sequence(),
+                    sequence
+                );
+            }
         }
 
         debug!(
diff --git a/server/src/grpc/remote_engine_service/mod.rs 
b/server/src/grpc/remote_engine_service/mod.rs
index df201a12..20b0b3da 100644
--- a/server/src/grpc/remote_engine_service/mod.rs
+++ b/server/src/grpc/remote_engine_service/mod.rs
@@ -149,7 +149,7 @@ struct ExecutePlanMetricCollector {
 
 impl ExecutePlanMetricCollector {
     fn new(
-        request_id: String,
+        request_id: RequestId,
         query: String,
         slow_threshold_secs: u64,
         priority: Priority,
@@ -157,7 +157,7 @@ impl ExecutePlanMetricCollector {
         Self {
             start: Instant::now(),
             query,
-            request_id: request_id.into(),
+            request_id,
             slow_threshold: Duration::from_secs(slow_threshold_secs),
             priority,
         }
@@ -711,12 +711,10 @@ impl RemoteEngineServiceImpl {
             priority,
         );
 
-        debug!(
-            "Execute remote query, ctx:{query_ctx:?}, query:{}",
-            &ctx.displayable_query
-        );
+        debug!("Execute remote query, id:{}", query_ctx.request_id.as_str());
+
         let metric = ExecutePlanMetricCollector::new(
-            ctx.request_id.to_string(),
+            query_ctx.request_id.clone(),
             ctx.displayable_query,
             slow_threshold_secs,
             query_ctx.priority,
@@ -775,8 +773,12 @@ impl RemoteEngineServiceImpl {
             ctx.timeout_ms,
             priority,
         );
+        debug!(
+            "Execute dedupped remote query, id:{}",
+            query_ctx.request_id.as_str()
+        );
         let metric = ExecutePlanMetricCollector::new(
-            ctx.request_id.to_string(),
+            query_ctx.request_id.clone(),
             ctx.displayable_query,
             slow_threshold_secs,
             query_ctx.priority,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to