Raj
Raj

Reputation: 107

How to Flow Drain suspended Flows?

I understand that I can do setFlowsDrainingModeEnabled to stop new flows and to let the older suspended or current work-in-process flows complete. I am satisfied about the current work-in-process flows.

The reason that the older flows are suspended is because they are waiting for some other counterparty flows in the network to complete. Unless the counterparty node comes alive or sorts its issues, the flow drain is incomplete.

CordaRPCOps.stateMachinesFeed.snapshot.size would be non-zero. This means there are pending and waiting flows.

If the flow has not completed its course, would I be indefinitely stopping the node for the upgrade?

Upvotes: 0

Views: 311

Answers (1)

Joel
Joel

Reputation: 23140

In Corda 3.1, you would proceed as follows:

  • Shut down the node
  • Clear the NODE_CHECKPOINTS table
  • For each row in the VAULT_STATES table:
    • Set LOCK_ID to null
    • Set LOCK_TIMESTAMP to null
  • Update the node
  • Restart the node

In Corda 4+, a CordaRPCOps.killFlow API will be introduced to kill suspended flows.

Upvotes: 1

Related Questions