Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2450,8 +2450,10 @@ void Service::Command(CmdArgList args, Transaction* tx, SinkReplyBuilder* builde
return builder->SendLong(cmd_cnt);
}

const bool sufficient_args = (args.size() == 2);

// INFO [cmd]
if (subcmd == "INFO" && args.size() == 2) {
if (subcmd == "INFO" && sufficient_args) {
string cmd = absl::AsciiStrToUpper(ArgS(args, 1));

if (const auto* cid = registry_.Find(cmd); cid) {
Expand All @@ -2464,6 +2466,10 @@ void Service::Command(CmdArgList args, Transaction* tx, SinkReplyBuilder* builde
return;
}

if (subcmd == "DOCS" && sufficient_args) {
return builder->SendOk();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about that. Perhaps some libraries will assume we don't support / have some commands if we return none?
Since this was introduced in Redis 7, perhaps we should keep it not implemented, or implement it properly?
@romange wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what Roman asked on the issue. To make it a noop. I was multitasking while waiting for a test to run and I patched this quickly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quoting Roman

we should make it a noop - and reply OK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw that reply :)
I'm not sure if Roman specifically considered the downside of perhaps breaking some clients, that's why I raised it

Copy link
Contributor Author

@kostasrim kostasrim Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhhh ok ok. We did that with other commands in the past so I guess it's fine 🤷‍♂️

But +1 that you mentioned/asked

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of clients that rely on it but in theory it can be used to provide dynamic support for commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall I close or merge this ? 🤷

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge it. let's learn about universe experimentally.

}

return builder->SendError(kSyntaxErr, kSyntaxErrType);
}

Expand Down
Loading