You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "baobaomaomeng (via GitHub)" <gi...@apache.org> on 2024/04/04 16:22:04 UTC
[PR] add scan substring,suffix [kvrocks]
baobaomaomeng opened a new pull request, #2222:
URL: https://github.com/apache/kvrocks/pull/2222
After modifying the code, I'm encountering some strange issues. I don't understand why this test is failing.



At the same time, there's a bit of a performance issue. I'm not sure about the optimal number of scans for substring matching and suffix matching, I haven't set a limit yet. In the next couple of days, I'll try to add support for HSCAN, SSCAN, and ZSCAN.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589909010
##########
.gitignore:
##########
@@ -40,9 +40,13 @@ version.h
.idea
.vscode
.cache
+.gitignore
compactdb
+test
testdb
build
cmake-build-*
+debug-build
+test
Review Comment:
duplicated `test`
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2038569995
@baobaomaomeng You can add a config to set the optimal number. We can talk about the default value later.
If this test case doesn't your need, you can hide it in your local.
You can use `./x.py check format` to format the code.
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2054093673
> @baobaomaomeng You can add a config to set the optimal number. We can talk about the default value later. If this test case doesn't your need, you can hide it in your local. You can use `./x.py check format` to format the code.
I've now added some tests,add support hsacn zscan and SSCAN, and the final step is to add configuration options. I'm not sure how to add configuration options, nor do I know what a good default number of search times would be. I feel like I need some help in this area.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589908503
##########
src/config/config.cc:
##########
@@ -152,6 +153,7 @@ Config::Config() {
{"pidfile", true, new StringField(&pidfile, kDefaultPidfile)},
{"max-io-mb", false, new IntField(&max_io_mb, 0, 0, INT_MAX)},
{"max-bitmap-to-string-mb", false, new IntField(&max_bitmap_to_string_mb, 16, 0, INT_MAX)},
+ {"max-scan-num", false, new IntField(&max_scan_num, 2, 0, INT_MAX)},
Review Comment:
Seems `2` is too smaller to be as the `max_scan_num`?
##########
src/storage/redis_db.cc:
##########
@@ -309,10 +314,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor, RedisType type) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
Review Comment:
`scan_matched_limt` and `scan_mismatched_limit` should be a better name in this scenario.
##########
.gitignore:
##########
@@ -40,9 +40,13 @@ version.h
.idea
.vscode
.cache
+.gitignore
compactdb
+test
testdb
build
cmake-build-*
+debug-build
+test
Review Comment:
duplicate line, it has been added in previous section.
##########
src/storage/redis_db.cc:
##########
@@ -309,10 +314,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor, RedisType type) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
Review Comment:
The parameter of the SCAN command is too long now, it's time to group the scan parameters into a struct.
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2059461170
> @baobaomaomeng That's great, thank you for your efforts.
>
> Regarding how to add configuration items, you can refer to [this PR](https://github.com/apache/kvrocks/pull/2217).
>
> The default number may be any number(such as 100,000). We can have the Reviewers confirm the final value, this modification is quite simple.
One point that confuses me is why the limit in the scan operator is not a configuration item, and now I need to add the maximum number to scan at once into the configuration items.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589936573
##########
src/storage/redis_db.cc:
##########
@@ -309,10 +314,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor, RedisType type) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
+ const std::string &match_str, std::vector<std::string> *keys, std::string *end_cursor,
+ RedisType type, const MatchType match_mode) {
Review Comment:
I just added two matching patterns.
such as
*llo matches ello,hello,eeeello
*l* matches l,ll,llo,ello,hello
And,i add scan_false_time limit to config,beacasue if we use suffix,substring match, we need scan one by one, and the potentially long time may be unacceptable. so I add this argument in scan,zsan,sscan,hscan command。I found that the three scan methods to get the last scanned key are all different, which is not convenient for me to modify,so i add a string value in CommandSubkeyScanBase to represented the last key that was scanned。
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2094086849
> In my opinion, we need a well-designed solution for implementing Redis glob-style patterns that is **scalable**, rather than just handling specific cases. If the design is not scalable, we may have to remove all modifications when aiming to support the complete pattern cases.
Thank you for your review, but this is not consistent with the goal I communicated at the beginning. I now need to rewrite my code, and I think I need to consider how to write it.Could you give me some reference suggestions?
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2074400583
@baobaomaomeng Hi, can you resolve the conflicts?
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589909281
##########
src/commands/scan_base.h:
##########
@@ -39,14 +41,20 @@ class CommandScanBase : public Commander {
return ParseAdditionalFlags<true>(parser);
}
-
Review Comment:
please don't introduce random changes.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice closed pull request #2222: Allow to scan keys with the suffix
URL: https://github.com/apache/kvrocks/pull/2222
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2054227434
@baobaomaomeng That's great, thank you for your efforts.
Regarding how to add configuration items, you can refer to [this PR](https://github.com/apache/kvrocks/pull/2217).
The default number may be any number(such as 100,000). We can have the Reviewers confirm the final value, this modification is quite simple.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589908989
##########
.gitignore:
##########
@@ -40,9 +40,13 @@ version.h
.idea
.vscode
.cache
+.gitignore
Review Comment:
why it's ignored?
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589933077
##########
src/config/config.cc:
##########
@@ -152,6 +153,7 @@ Config::Config() {
{"pidfile", true, new StringField(&pidfile, kDefaultPidfile)},
{"max-io-mb", false, new IntField(&max_io_mb, 0, 0, INT_MAX)},
{"max-bitmap-to-string-mb", false, new IntField(&max_bitmap_to_string_mb, 16, 0, INT_MAX)},
+ {"max-scan-num", false, new IntField(&max_scan_num, 2, 0, INT_MAX)},
Review Comment:
it's just for test easy,jihuayu say they will determine the final value.
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589619140
##########
src/commands/cmd_server.cc:
##########
@@ -878,7 +878,7 @@ class CommandScan : public CommandScanBase {
std::vector<std::string> keys;
std::string end_key;
- auto s = redis_db.Scan(key_name, limit_, prefix_, &keys, &end_key);
+ auto s = redis_db.Scan(key_name, limit_, srv->GetConfig()->max_scan_num, prefix_, &keys, &end_key, pm_);
Review Comment:
I have no clue about this, do you have any suggestions?
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589909132
##########
tests/gocase/unit/scan/scan_test.go:
##########
@@ -187,7 +187,27 @@ func ScanTest(t *testing.T, rdb *redis.Client, ctx context.Context) {
require.Equal(t, []string{"1", "10", "foo", "foobar"}, keys)
})
- t.Run("ZSCAN with PATTERN", func(t *testing.T) {
+ t.Run("HSCAN with subkey PATTERN", func(t *testing.T) {
Review Comment:
seems we need more test cases
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2094050715
In my opinion, we need a well-designed solution for implementing Redis glob-style patterns that is **scalable**, rather than just handling specific cases. If the design is not scalable, we may have to remove all modifications when aiming to support the complete pattern cases.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589932385
##########
.gitignore:
##########
@@ -40,9 +40,13 @@ version.h
.idea
.vscode
.cache
+.gitignore
Review Comment:
I'm sorry, that was my oversight.
--
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
Re: [PR] add scan substring,suffix [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1577532298
##########
src/commands/cmd_server.cc:
##########
@@ -878,7 +878,7 @@ class CommandScan : public CommandScanBase {
std::vector<std::string> keys;
std::string end_key;
- auto s = redis_db.Scan(key_name, limit_, prefix_, &keys, &end_key);
+ auto s = redis_db.Scan(key_name, limit_, srv->GetConfig()->max_scan_num, prefix_, &keys, &end_key, pm_);
Review Comment:
This code looks ugly. Can we have some good way to deal with config?
##########
src/storage/redis_db.cc:
##########
@@ -359,28 +363,57 @@ rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const
}
uint16_t slot_id = slot_start;
+
+ auto scan_match_check = [&]() -> bool {
+ if (ns_prefix.empty()) {
+ return true;
+ }
+ if (!iter->key().starts_with(ns_prefix)) {
+ return false;
+ }
+ auto key_view = iter->key().ToStringView();
+ auto sub_key_view = static_cast<Slice>(key_view.substr(ns_prefix.size(), key_view.size() - ns_prefix.size()));
+ if (pm == 1 && !sub_key_view.ends_with(fix)) {
+ return false;
+ } else if (pm == 2 && sub_key_view.ToStringView().find(fix) == std::string::npos) {
+ return false;
+ }
+ return true;
+ };
+
while (true) {
- for (; iter->Valid() && cnt < limit; iter->Next()) {
- if (!ns_prefix.empty() && !iter->key().starts_with(ns_prefix)) {
- break;
+ for (; iter->Valid() && cnt_success < scan_success_limit; iter->Next()) {
+ if (!scan_match_check()) {
+ cnt_false++;
+ if (cnt_false < scan_false_limit) {
+ continue;
+ }
}
+ // The user_key must be updated either when the scan is successful, or when the number of consecutive failures
+ // reaches its limit
Metadata metadata(kRedisNone, false);
auto s = metadata.Decode(iter->value());
if (!s.ok()) continue;
if (metadata.Expired()) continue;
std::tie(std::ignore, user_key) = ExtractNamespaceKey<std::string>(iter->key(), storage_->IsSlotIdEncoded());
+ if (cnt_false >= scan_false_limit) {
+ break;
+ }
keys->emplace_back(user_key);
- cnt++;
+ cnt_success++;
}
- if (!storage_->IsSlotIdEncoded() || prefix.empty()) {
- if (!keys->empty() && cnt >= limit) {
+ if (!storage_->IsSlotIdEncoded() || fix.empty()) {
+ if (!keys->empty() && (cnt_success >= scan_success_limit)) {
+ end_cursor->append(user_key);
+ }
+ if (keys->empty() && cnt_false >= scan_false_limit) {
end_cursor->append(user_key);
}
Review Comment:
There may be a situation where some keys have been found, but `cnt_false >= scan_false_limit`.
##########
src/storage/redis_db.cc:
##########
@@ -359,28 +363,57 @@ rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const
}
uint16_t slot_id = slot_start;
+
+ auto scan_match_check = [&]() -> bool {
+ if (ns_prefix.empty()) {
+ return true;
+ }
+ if (!iter->key().starts_with(ns_prefix)) {
+ return false;
+ }
+ auto key_view = iter->key().ToStringView();
+ auto sub_key_view = static_cast<Slice>(key_view.substr(ns_prefix.size(), key_view.size() - ns_prefix.size()));
+ if (pm == 1 && !sub_key_view.ends_with(fix)) {
+ return false;
+ } else if (pm == 2 && sub_key_view.ToStringView().find(fix) == std::string::npos) {
+ return false;
+ }
+ return true;
+ };
+
while (true) {
- for (; iter->Valid() && cnt < limit; iter->Next()) {
- if (!ns_prefix.empty() && !iter->key().starts_with(ns_prefix)) {
- break;
+ for (; iter->Valid() && cnt_success < scan_success_limit; iter->Next()) {
+ if (!scan_match_check()) {
+ cnt_false++;
+ if (cnt_false < scan_false_limit) {
+ continue;
+ }
}
+ // The user_key must be updated either when the scan is successful, or when the number of consecutive failures
+ // reaches its limit
Metadata metadata(kRedisNone, false);
auto s = metadata.Decode(iter->value());
if (!s.ok()) continue;
if (metadata.Expired()) continue;
std::tie(std::ignore, user_key) = ExtractNamespaceKey<std::string>(iter->key(), storage_->IsSlotIdEncoded());
+ if (cnt_false >= scan_false_limit) {
+ break;
+ }
Review Comment:
Why not put those codes to begin?
```C++
if (!scan_match_check()) {
cnt_false++;
if (cnt_false < scan_false_limit) {
continue;
} else {
break;
}
}
```
##########
src/commands/scan_base.h:
##########
@@ -83,6 +89,7 @@ class CommandScanBase : public Commander {
std::string cursor_;
std::string prefix_;
int limit_ = 20;
+ int pm_ = 0;
Review Comment:
Can you use enum instead of it?
Can you change and rename it to `prefix_mode_`?
##########
src/storage/redis_db.cc:
##########
@@ -322,10 +327,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
+ const std::string &fix, std::vector<std::string> *keys, std::string *end_cursor,
+ const int pm) {
Review Comment:
Can you change the param `fix` to a more meaningful name? Can you keep the name the same as the header file?
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "baobaomaomeng (via GitHub)" <gi...@apache.org>.
baobaomaomeng commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1590289058
##########
src/storage/redis_db.cc:
##########
@@ -309,10 +314,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor, RedisType type) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
+ const std::string &match_str, std::vector<std::string> *keys, std::string *end_cursor,
+ RedisType type, const MatchType match_mode) {
Review Comment:
I've been thinking about how to design a scalable scan, but I don't have any ideas. This might be a bit difficult for me. I think I need some guidance on the thought process right now.
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#discussion_r1589910802
##########
src/storage/redis_db.cc:
##########
@@ -309,10 +314,12 @@ rocksdb::Status Database::Keys(const std::string &prefix, std::vector<std::strin
return rocksdb::Status::OK();
}
-rocksdb::Status Database::Scan(const std::string &cursor, uint64_t limit, const std::string &prefix,
- std::vector<std::string> *keys, std::string *end_cursor, RedisType type) {
+rocksdb::Status Database::Scan(const std::string &cursor, uint64_t scan_success_limit, uint64_t scan_false_limit,
+ const std::string &match_str, std::vector<std::string> *keys, std::string *end_cursor,
+ RedisType type, const MatchType match_mode) {
Review Comment:
I have some questions about your design.
But before that, could you give a little introduction about your general design and supported patterns in the PR description?
Then we can have a detailed review on your code.
Refer to Redis glob-style patterns:
>Supported glob-style patterns:
>
>`h?llo` matches hello, hallo and hxllo
`h*llo` matches hllo and heeeello
`h[ae]llo` matches hello and hallo, but not hillo
`h[^e]llo` matches hallo, hbllo, ... but not hello
`h[a-b]llo` matches hallo and hbllo
>
--
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
Re: [PR] Allow to scan keys with the suffix [kvrocks]
Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on PR #2222:
URL: https://github.com/apache/kvrocks/pull/2222#issuecomment-2443750365
closed by #2608.
--
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