diff --git a/src/storage.rs b/src/storage.rs index 376d1d54b908d957aed4bd041c9dad1cf836bba2..61f77ee12e5f3d56327745bf33454bdc40c90d66 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -3893,14 +3893,12 @@ impl PluginMigration { }] } - #[inline] - pub fn put( - &self, - plugin_name: &str, - migration_file: &str, - hash: md5::Digest, - ) -> tarantool::Result<()> { - self.space.replace(&(plugin_name, migration_file, hash.0))?; + pub fn delete_all_by_plugin(&self, plugin_name: &str) -> tarantool::Result<()> { + let records = self.get_files_by_plugin(plugin_name)?; + for record in records { + self.space + .delete(&(record.plugin_name, record.migration_file))?; + } Ok(()) } diff --git a/src/traft/node.rs b/src/traft/node.rs index af00be49e3e6bee9d93fa5ebf0c3be47b90cc43d..7c664df079ebcafd4bff2741cc8eff41a492caf8 100644 --- a/src/traft/node.rs +++ b/src/traft/node.rs @@ -1349,6 +1349,10 @@ impl NodeImpl { .plugin .delete(&ident) .expect("storage should not fail"); + self.storage + .plugin_migration + .delete_all_by_plugin(&ident.name) + .expect("say it with me"); } }