refactor: drop the legacy canister_log store from SystemState#10821
Draft
mraszyk wants to merge 2 commits into
Draft
refactor: drop the legacy canister_log store from SystemState#10821mraszyk wants to merge 2 commits into
mraszyk wants to merge 2 commits into
Conversation
The one-time migration from the legacy `CanisterLog` store to the `LogMemoryStore` has completed on all subnets and the dual-write kept the legacy store around only so checkpoints stayed readable by replicas that predate the log memory store (see #10755). That downgrade window has now elapsed, so the legacy store and its serialized fields can be removed. - Remove the `SystemState.canister_log` field; constructors and `new_from_checkpoint` no longer take or initialize it, and the `CanisterState` log wrappers (`clear_log`/`remove_log`/`set_log`) operate solely on `log_memory_store`. `set_log` now takes a `LogMemoryStore` instead of a `(CanisterLog, LogMemoryStore)` tuple. - Drop the dual-write in `SandboxSafeSystemState`: the transient delta log now feeds only `log_memory_store`. - Stop serializing `canister_log_records`, `next_canister_log_record_idx` and `log_memory_store_migrated`; the corresponding proto fields (43, 44, 66) are marked reserved. Remove the obsolete `canister_log` vs `log_memory_store` next-index consistency check in checkpoint loading. - Replace the `StateMachine::canister_log` test helper with `canister_log_records` and `canister_log_bytes_used`, reading directly from `LogMemoryStore` (via a new test-only `LogMemoryStore::all_records_for_testing`), and migrate all callers. The `CanisterLog` type and the transient `SystemStateModifications` delta log buffer are retained. This re-applies the parts of the reverted #10714 that were left as a follow-up in #10755. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mraszyk
commented
Jul 19, 2026
| const METRIC_PAYLOAD_SIZE: usize = 1_000; | ||
|
|
||
| #[test] | ||
| fn test_metric_canister_log_memory_usage_bytes_from_canister_log() { |
Contributor
Author
There was a problem hiding this comment.
covered by test_metric_canister_log_memory_usage_bytes_from_log_memory_store
`records_mut` is now used in production by `LogMemoryStore::append_delta_log` (it drains the delta records into the ring buffer), so the `#[allow(dead_code)]` and its `TODO(DSM-11)` — which was conditioned on the log memory store being used in production — are no longer needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The one-time migration from the legacy
CanisterLogstore to theLogMemoryStorehas completed on all subnets and the dual-write kept the legacy store around only so checkpoints stayed readable by replicas that predate the log memory store (see #10755). That downgrade window has now elapsed and the migration code has already been removed, so the legacy store and its serialized fields can be removed.SystemState.canister_logfield;canister_log_records,next_canister_log_record_idxandlog_memory_store_migrated; the corresponding proto fields (43, 44, 66) are marked reserved.StateMachine::canister_logtest helper withcanister_log_recordsandcanister_log_bytes_used, reading directly fromLogMemoryStore(via a new test-onlyLogMemoryStore::all_records_for_testing), and migrate all callers.The
CanisterLogtype and the transientSystemStateModificationsdelta log buffer are retained. This re-applies the parts of the reverted #10714 that were left as a follow-up in #10755.