Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use EVALSHA in replication channel #558

Closed
antirez opened this Issue · 2 comments

1 participant

@antirez
Owner

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.

@antirez antirez was assigned
@antirez
Owner

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

@antirez
Owner

Done, closing.

@antirez antirez closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.