Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use EVALSHA in replication channel #558

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

Comments

Projects
None yet
1 participant
Owner

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

Owner

antirez commented Sep 17, 2012

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

Owner

antirez commented Jun 27, 2013

Done, closing.

@antirez antirez closed this Jun 27, 2013

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