hiero-ledger / hiero-ledger/hiero-consensus-node

During freeze, serialize all pending user transactions to disk

Open
#26,913 3 comments 0 reactions 0 assignees View on GitHub
Hedera Software Update Performance
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

This is a part of MDT (Minimal Down Time upgrades) effort: https://github.com/hiero-ledger/hiero-consensus-node/issues/25820

Here is what happens during freeze today:
* The platform enters the FREEZING state
* User transactions are no longer accepted, but there may still be many in the transaction pool
* Platform continue creating events as long as there are signature transactions available, then it stops
* Transactions might be left stranded in the transaction pool, and lost at shutdown

This is not ideal because transactions can be lost forever.

The idea is to listen for the `FREEZING` state and save all the pending transactions to disk immediately. `getTransactionsForEvent()` would then return an empty set. The writing of transactions to disk should be performed asychronously to avoid adding more time to the outage window. Because the platform controls the transition to `FREEZE_COMPLETE,` the app would have to invoke a new method on the `Platform` indicating that the transactions are on disk. The platform would not transition to `FREEZE_COMPLETE` until it has received this signal and the freeze state is on disk.

At startup, when the platform enters `REPLAYING_EVENTS`, the application should load the transactions back to memory, so they are included to the next `getTransactionsForEvent()` result.

It needs to make sure no user transactions are lost during freeze. That is, the gRPC server should be shut down first to make sure no new transactions are received. My assumption is this must happen in the FREEZE status handler. Then save the accumulated transactions to disk.

Contributor guide

Open the contributing guide

Research direction

Start with the FREEZING state handler, getTransactionsForEvent(), the Platform transition API, and the gRPC server shutdown path. Trace startup handling for REPLAYING_EVENTS as well. Done means pending transactions are saved asynchronously before FREEZE_COMPLETE and restored for the next getTransactionsForEvent() result without accepting new transactions during the freeze.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.