From 7e67365ff9ec3f418176d7fb92ff5b7996e9eeac Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Thu, 7 Nov 2024 14:48:43 +0000 Subject: [PATCH] Re-queue all canisters to ensure all have fully migrated (#6760) --- backend/canisters/local_group_index/CHANGELOG.md | 4 ++++ .../impl/src/lifecycle/post_upgrade.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/canisters/local_group_index/CHANGELOG.md b/backend/canisters/local_group_index/CHANGELOG.md index 0f2e295a7f..ea109fc5de 100644 --- a/backend/canisters/local_group_index/CHANGELOG.md +++ b/backend/canisters/local_group_index/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +### Changed + +- Re-queue all canisters to ensure all have fully migrated ([#6760](https://github.com/open-chat-labs/open-chat/pull/6760)) + ## [[2.0.1432](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1432-local_group_index)] - 2024-11-06 ### Changed diff --git a/backend/canisters/local_group_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/local_group_index/impl/src/lifecycle/post_upgrade.rs index 45e0149e2c..7b49d42da4 100644 --- a/backend/canisters/local_group_index/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/local_group_index/impl/src/lifecycle/post_upgrade.rs @@ -7,6 +7,7 @@ use ic_cdk::post_upgrade; use local_group_index_canister::post_upgrade::Args; use stable_memory::get_reader; use tracing::info; +use types::CanisterId; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -15,9 +16,16 @@ fn post_upgrade(args: Args) { let memory = get_upgrades_memory(); let reader = get_reader(&memory); - let (data, errors, logs, traces): (Data, Vec, Vec, Vec) = + let (mut data, errors, logs, traces): (Data, Vec, Vec, Vec) = msgpack::deserialize(reader).unwrap(); + data.canisters_pending_events_migration_to_stable_memory = data + .local_groups + .iter() + .map(|(g, _)| CanisterId::from(*g)) + .chain(data.local_communities.iter().map(|(c, _)| CanisterId::from(*c))) + .collect(); + canister_logger::init_with_logs(data.test_mode, errors, logs, traces); let env = init_env(data.rng_seed);