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

laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 82d981f51 fix(logging): remove too verbose log when key not found 
(#1829)
82d981f51 is described below

commit 82d981f51cf5e7b22971f9ac3f26f02a063600fe
Author: Yingchun Lai <[email protected]>
AuthorDate: Thu Jan 4 18:55:23 2024 +0800

    fix(logging): remove too verbose log when key not found (#1829)
    
    Don't log "client read encountered an unhandled error: 1" when the key is 
not found.
---
 src/replica/replica.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/replica/replica.cpp b/src/replica/replica.cpp
index 62cd71ae9..3274dc081 100644
--- a/src/replica/replica.cpp
+++ b/src/replica/replica.cpp
@@ -438,7 +438,10 @@ void replica::on_client_read(dsn::message_ex *request, 
bool ignore_throttling)
 
     CHECK(_app, "");
     auto storage_error = _app->on_request(request);
-    if (dsn_unlikely(storage_error != ERR_OK)) {
+    // kNotFound is normal, it indicates that the key is not found (including 
expired)
+    // in the storage engine, so just ignore it.
+    if (dsn_unlikely(storage_error != rocksdb::Status::kOk &&
+                     storage_error != rocksdb::Status::kNotFound)) {
         switch (storage_error) {
         // TODO(yingchun): Now only kCorruption and kIOError are dealt, 
consider to deal with
         //  more storage engine errors.


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

Reply via email to