Skip to content
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

Use EVALSHA in replication channel #558

Closed
antirez opened this issue Jun 18, 2012 · 2 comments
Closed

Use EVALSHA in replication channel #558

antirez opened this issue Jun 18, 2012 · 2 comments

Comments

@antirez
Copy link
Contributor

antirez commented Jun 18, 2012

Currently the full script is sent in the replication channel (and the master makes sure to remember the full original source of a script into an hash table). However taking track of what was already sent to a given slave is pretty straightforward, even using constant memory and evicting elements at random or using sampling and oldest time.

The implementation of this thing should look like that (but don't consider this a final specification as probably I may change something during the implementation):

  • Slave don't accept SCRIPT FLUSH command.
  • Master propagates SCRIPT FLUSH command to slave.
  • There is a per-slave hash table mapping SHA1 -> time, with all the scripts already transmitted to the slave.
  • Optionally we can evict SHA1s if a given limit per slave is reached, but likely not a good idea to start. In sane environments scripts are just a few.
  • SCRIPT FLUSH on master flushes also the per-slave dictionaries, other than propagating a SCRIPT FLUSH everywhere.

Maybe the same approach could be used for the AOF as well? Think about it.

@ghost ghost assigned antirez Jun 18, 2012
@antirez
Copy link
Contributor Author

antirez commented Sep 17, 2012

Moved to 2.8 milestone in order to release 2.6 final ASAP.

@antirez
Copy link
Contributor Author

antirez commented Jun 27, 2013

Done, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant