You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/09 12:01:53 UTC

[GitHub] [incubator-kvrocks] caipengbo commented on a diff in pull request #628: Fix RocksDB can't auto resume after disk quota exceeded error

caipengbo commented on code in PR #628:
URL: https://github.com/apache/incubator-kvrocks/pull/628#discussion_r893416802


##########
src/event_listener.cc:
##########
@@ -59,6 +59,18 @@ const std::string compressType2String(const rocksdb::CompressionType type) {
   return iter->second;
 }
 
+bool isDiskQuotaExceeded(const rocksdb::Status &bg_error) {
+    // EDQUOT: Disk quota exceeded (POSIX.1-2001)
+    std::string edquot_str = "Disk quota exceeded";
+    std::string err_msg = bg_error.ToString();
+
+    if (err_msg.length() < edquot_str.length()) {
+        return false;
+    }
+
+    return edquot_str == err_msg.substr(err_msg.size()-edquot_str.size());

Review Comment:
   Yes, we can use find. The reason I use tail matching is to know that it can only be at the tail, which is probably a little bit faster than find.
   It doesn't seem necessary. I will use find API.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org