You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "zncleon (via GitHub)" <gi...@apache.org> on 2023/09/01 08:13:46 UTC

[GitHub] [kvrocks] zncleon commented on a diff in pull request #1721: Add the support of SCALING for bloom filter

zncleon commented on code in PR #1721:
URL: https://github.com/apache/kvrocks/pull/1721#discussion_r1312716997


##########
src/types/redis_bloom_chain.cc:
##########
@@ -147,18 +171,23 @@ rocksdb::Status BloomChain::Add(const Slice &user_key, const Slice &item, int *r
 
   // insert
   if (!exist) {
-    if (metadata.size + 1 > metadata.GetCapacity()) {  // TODO: scaling would be supported later
-      return rocksdb::Status::Aborted("filter is full");
+    if (metadata.size + 1 > metadata.GetCapacity()) {
+      if (metadata.IsScaling()) {
+        s = createBloomFilter(ns_key, &metadata);
+        if (!s.ok()) return s;
+      } else {
+        return rocksdb::Status::Aborted("filter is full and is nonscaling");
+      }
     }
     s = bloomAdd(bf_key_list.back(), item_string);

Review Comment:
   Sure, it certainly needs to be enlarged. I think I mistakenly missed it.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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