Mnesia -> Khepri fails when changes are made during the migration #9786
-
Hello!, We've been doing some Khepri migration testing, and came across an issue which we thought be best to report. We kept getting crashes during large migrations (many exchanges/bindings, time consuming) and realised that root cause seems to be when a user (or any other object potentially) is deleted/created/updated during the migration. The crash also put the cluster in a broken state, and only recovers when we reset the cluster. Is the migration not expected to handle changes to tables during migration? To reproduce:
log excerpt:
Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@markus812498 migration cannot and will not "double check" if there were any changes during its run but it probably can avoid exceptions. For example, logging a warning should be enough. A similar scenario with collections ("modified during iteration") in many programming languages would result in an exception by design but it would be much more practical for RabbitMQ to continue migrating. |
Beta Was this translation helpful? Give feedback.
-
@markus812498 please give it a shot. |
Beta Was this translation helpful? Give feedback.
khepri_mnesia_migration
migration doesn't double-check but it subscribes to Mnesia changes. Therefore, it won't miss changes happening in parallel to the initial copy.This exception is a bug: in some place we apparently forget to "unpack" the
{Module, Arguments}
tuple before callingModule:delete_from_khepri()
.