Skip to content

Conversation

@enjoy-binbin
Copy link
Contributor

@enjoy-binbin enjoy-binbin commented Jun 7, 2023

We now no longer propagate scripts (started from 7.0), so this is a
very rare issue that in nearly-dead-code.

This is an overlook in #9780

@enjoy-binbin
Copy link
Contributor Author

looks like we don't have tests that cover it

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

This looks like an overlook yes. Good catch!

This could have been avoided if we would not use return at all, but instead if, else if ... else in this function.

Would it be too hard to add a test for that case?

@enjoy-binbin
Copy link
Contributor Author

Would it be too hard to add a test for that case?

It seems hard, I want to add it, but I haven't thought of a good way yet

@MeirShpilraien
Copy link

MeirShpilraien commented Jun 7, 2023

I believe we dropped script replication on 7.0 so this is basically a dead code, no?

@oranagra
Copy link
Member

oranagra commented Jun 7, 2023

The code could be alive if we're replicating from an older master, or reading an old (or specially crafted)AOF file

@oranagra
Copy link
Member

oranagra commented Jun 7, 2023

Not sure this is worth the trouble of writing a test or refactoring the code. I'm ok merging it as is.
If we do wanna test it, then generating an AOF with a script is the easiest.

@enjoy-binbin
Copy link
Contributor Author

enjoy-binbin commented Jun 8, 2023

Not sure this is worth the trouble of writing a test or refactoring the code. I'm ok merging it as is.
If we do wanna test it, then generating an AOF with a script is the easiest.

i see in aof.tcl, we have a EVAL timeout with slow verbatim Lua script from AOF test, i can easier reuse it
the another question is, SCRIPT KILL is not a LOADING command, so if we are loading a aof (with busy script), we cannot issue the KILL command. should we change these KILL commands to LOADING? if so, open a new PR to add it?

@oranagra
Copy link
Member

oranagra commented Jun 8, 2023

no, SCRIPT KILL should not be allowed during loading (since the script in that case would be from the AOF file, and we should not kill it).
we should also probably have prevented SCRIPT KILL from killing scripts that were sent from the master, but i don't think we should bother with that now (since we no longer propagate scripts).
i think we can merge this fix just for clean code, under the understanding that it's a very rare issue that in nearly-dead-code.

@enjoy-binbin
Copy link
Contributor Author

got it, let's merge it

@oranagra oranagra merged commit e4d183a into redis:unstable Jun 8, 2023
@enjoy-binbin enjoy-binbin deleted the add_missing_return branch June 8, 2023 12:16
oranagra pushed a commit that referenced this pull request Jul 10, 2023
We now no longer propagate scripts (started from 7.0), so this is a
very rare issue that in nearly-dead-code.

This is an overlook in #9780

(cherry picked from commit e4d183a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants