dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.96k stars 954 forks source link

fix(server): handle running script load inside multi #4074

Closed adiholden closed 1 week ago

adiholden commented 2 weeks ago

fix #4071 2 bugs found in the flow:

  1. we did not use the interperter borrowed in the script load command before running the multi transaction
  2. we call InitByArgs for each command in multi transaction. in this flow Transaction::sharddata must not be resized to 1. (see comment here - https://github.com/dragonflydb/dragonfly/blob/f8b3fa0d7bf1d95674f80eef826ffd66f5a57659/src/server/transaction.cc#L343) When calling script load we resized it to 1 leading to the crash.