Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Redis Programmability Documentation#1725

Merged
oranagra merged 20 commits intoredis:masterfrom
MeirShpilraien:redis_programibility_docs
Jan 30, 2022
Merged

Redis Programmability Documentation#1725
oranagra merged 20 commits intoredis:masterfrom
MeirShpilraien:redis_programibility_docs

Conversation

@MeirShpilraien
Copy link

The PR add Redis Programability documentation:

  • Documentation to all FUNCTION commands (notice that FUNCTION INFO is not documented because its about to be dropped on Redis Function Libraries redis#10004):
    • FUNCTION LOAD (current named FUNCTION CREATE but will be renamed after this will be merged)
    • FUNCTION DELETE
    • FUNCTION DUMP
    • FUNCTION FLUSH
    • FUNCTION KILL
    • FUNCTION LIST
    • FUNCTION RESTORE
    • FUNCTION FLUSH
  • Introduction to Redis Functions page
  • Rearrangement of EVAL command page
    • All the information on EVAL command page was moved and split between 2 pages:
      • Introduction to Eval scripts
      • Lua API for Redis Scripts
  • New Redis programibality page

The PR also require changes on redis-io that was made here

The PR add Redis Programability documentation:
* Documentation to all FUNCTION commands (notice that FUNCTION INFO is not documented because its about to be dropped):
  * FUNCTION LOAD (current named FUNCTION CREATE but will be renamed after [this](redis/redis#10004) will be merged)
  * FUNCTION DELETE
  * FUNCTION DUMP
  * FUNCTION FLUSH
  * FUNCTION KILL
  * FUNCTION LIST
  * FUNCTION RESTORE
  * FUNCTION FLUSH
* Introduction to Redis Functions page
* Rearrangement of `EVAL` command page
  * All the information on `EVAL` command page was moved and split between 2 pages:
    * Introduction to Eval scripts
    * Lua API for Redis Scripts
* New Redis programibality page

The PR also require changes on redis-io that was made [here](redis/redis-io#261)
@MeirShpilraien MeirShpilraien force-pushed the redis_programibility_docs branch from d746a36 to 55026a2 Compare December 30, 2021 10:48
@MeirShpilraien
Copy link
Author

Forced pus to apply the formatter.

@MeirShpilraien MeirShpilraien force-pushed the redis_programibility_docs branch from 55026a2 to d746a36 Compare December 30, 2021 11:34
@MeirShpilraien
Copy link
Author

Revert formatter changes according to @oranagra instructions.

@oranagra oranagra added the to-be-merged should probably be merged soon label Jan 2, 2022
@zuiderkwast zuiderkwast self-requested a review January 11, 2022 13:05
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.

That's a lot of changes! 😅

Most of my comments are on typos/spellning/grammar. (That's what catches my attention more than the big picture...)

Regarding the overall structure: The background of Functions describing why Eval scripts are not enough should maybe not be such large part of the beginning of the Functions document? Or at least it can be placed under a sub-heading like "Why Functions?" and not be first on that page?

That background is very biased against Eval and for Functions. On the evalintro page (previously the eval command docs) a similar description is biased towards eval and against a hypothetical server-defined script functionality (written before functions existed).

Maybe it's better to put the comparison of Eval vs Functions on the programability page? Without bias to either of them, just facts?

@itamarhaber
Copy link
Member

@zuiderkwast sorry for not stopping you - I was reviewing this and it took me a while to complete. Please feel free to give the updated a look.

@zuiderkwast
Copy link
Contributor

@itamarhaber I'm assuming you have already fixed the grammar/spelling/typos I commented on, so I'll mark them all as resolved. Feel free to go though my comments and unresolve them if you find that any of them are still relevant.

Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

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

i didn't read the LDB section, i assume it's mostly copy paste from somewhere.
i didn't go over all the deleted text that was in eval.md to make sure it survived the transition (i.e. that all the valuable info there still exists somewhere).
i only skimmed though the lua-api.md file (reviewed it's top part, but not all the gory details, which i assume are mostly copy-paste)

@oranagra
Copy link
Member

@itamarhaber I'm assuming you have already fixed the grammar/spelling/typos I commented on, so I'll mark them all as resolved. Feel free to go though my comments and unresolve them if you find that any of them are still relevant.

while reviewing it myself (in the files tab on github), i saw quite a few of @zuiderkwast's wording comment still showing. i think this means that they where probably commented on lines that @itamarhaber didn't change in his edit.

that said, i mostly care now about the right content that tells the story correctly and doesn't miss any important detail, and less about wording 😄

@itamarhaber itamarhaber changed the title Redis Programability Documentation Redis Programmability Documentation Jan 18, 2022
@itamarhaber
Copy link
Member

@oranagra all of @zuiderkwast's comments were marked as outdated for me, and I took care when resolving them one by one to make sure I edited them (even if not according to the comment's suggestion).

Let future readers proof-read this /wink wink, nudge nudge @banker & @elena-kolevska

@oranagra
Copy link
Member

i suggest holding back the call for additional reviewer until after some of my comments are addressed.

meir added 3 commits January 22, 2022 17:39
* lua-api.md
   * Splitted `redis.register_function` to positional argument and named arguments
   * Added redis.REDIS_VERSION API documentaion
   * Added redis.REDIS_VERSION_NUM API documentaion
* functions-into.md
   * Added section about functions flags with example and flags documentation.
For more information about function flags refer to [Function Flags](functions-intro#function-flags)
#### <a name="script_flags"></a> Script Flags

The following is a list of supported script flags:
Copy link
Member

Choose a reason for hiding this comment

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

i think we should mention the default.
i.e. on functions, all these flags are off by default.
on eval... when shebang is used, it's the same, but if it's not used, it's a different story (maybe refer to another section)
@yoav-steinberg FYI

Co-authored-by: Oran Agra <oran@redislabs.com>
Comment on lines +7 to +11
Otherwise, this is a map with the following keys:
* **name:** the name of the function.
* **command:** the command and arguments used for invoking the function.
* **duration_ms:** the function's runtime duration in milliseconds.
2. `engines`: this is an array of simple strings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Blanks needed for correct rendering of the list IIRC.

Suggested change
Otherwise, this is a map with the following keys:
* **name:** the name of the function.
* **command:** the command and arguments used for invoking the function.
* **duration_ms:** the function's runtime duration in milliseconds.
2. `engines`: this is an array of simple strings.
Otherwise, this is a map with the following keys:
* **name:** the name of the function.
* **command:** the command and arguments used for invoking the function.
* **duration_ms:** the function's runtime duration in milliseconds.
2. `engines`: this is an array of simple strings.

Comment on lines +422 to +428
By default, Redis assumes that all functions read and write data.
This results in the following behavior:

1. Functions can read and write data.
1. Functions can run in cluster mode.
1. Execution against a stale replica is denied to avoid inconsistent reads.
1. Execution under low memory is denied to avoid exceeding the configured threshold.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add that it's denied in a read-only replica?

Lastly, when data persistence is at risk due to a disk error, execution is blocked as well.

Using this flag allows executing the function:
1. With `FCALL_RO` against masters and read-only replicas.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. With `FCALL_RO` against masters and read-only replicas.
1. With `FCALL_RO` against masters and read-only replicas.

@enjoy-binbin enjoy-binbin mentioned this pull request Jan 25, 2022
@enjoy-binbin
Copy link
Contributor

remember not to forget those new INFO fields, i mention it in #1748

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

to-be-merged should probably be merged soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants