-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(search_family): Add basic support for the FT.CONFIG command #4779
base: main
Are you sure you want to change the base?
feat(search_family): Add basic support for the FT.CONFIG command #4779
Conversation
<< CI{"FT.ALTER", CO::WRITE | CO::GLOBAL_TRANS, -3, 0, 0, acl::FT_SEARCH}.HFUNC(FtAlter) | ||
<< CI{"FT.DROPINDEX", CO::WRITE | CO::GLOBAL_TRANS, -2, 0, 0, acl::FT_SEARCH}.HFUNC( | ||
FtDropIndex) | ||
<< CI{"FT.CONFIG", CO::WRITE | CO::GLOBAL_TRANS, -3, 0, 0, acl::FT_SEARCH}.HFUNC(FtConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not sure what options should I set here, But I think since we are going to remove mutexes it sould be GLOBAL_TRANS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be GLOBAL anycase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you also need to add NO_KEY_TRANSACTIONAL
fee09ba
to
1d82c85
Compare
fixes dragonflydb#4352 Signed-off-by: Stepan Bagritsevich <[email protected]>
1d82c85
to
1aabaed
Compare
DVLOG(2) << "Setting " << option << " to " << value; | ||
|
||
auto cb = [option, value](util::ProactorBase*) { UpdateConfigOption(option, value); }; | ||
server_family_->service().proactor_pool().AwaitFiberOnAll(std::move(cb)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't meed server_family, you can use shard_set->pool()->AwaitFiberOnAll
@@ -24,8 +24,10 @@ | |||
#include "server/conn_context.h" | |||
#include "server/container_utils.h" | |||
#include "server/engine_shard_set.h" | |||
#include "server/main_service.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need it?
#include "server/search/aggregator.h" | ||
#include "server/search/doc_index.h" | ||
#include "server/server_family.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove
void SearchFamily::FtConfigSet(CmdArgList args, const CommandContext& cmd_cntx) { | ||
CmdArgParser parser{args}; | ||
auto* rb = static_cast<RedisReplyBuilder*>(cmd_cntx.rb); | ||
|
||
string_view option = parser.Next(); | ||
uint64_t value = parser.Next<uint64_t>(); | ||
|
||
if (auto err = parser.Error(); err) | ||
return rb->SendError(err->MakeReply()); | ||
|
||
auto option_exists = FindOptionsMapValue(kConfigOptions, option); | ||
if (option_exists) { | ||
DVLOG(2) << "Setting " << option << " to " << value; | ||
|
||
auto cb = [option, value](util::ProactorBase*) { UpdateConfigOption(option, value); }; | ||
server_family_->service().proactor_pool().AwaitFiberOnAll(std::move(cb)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if we have 2 simultaneous commands?
fixes #4352
Add basic support of the
MAXSEARCHRESULTS
andMAXAGGREGATERESULTS
options.Issue with other options: #4780