diff --git a/docs/source/resources/validation-consensus.png b/docs/source/resources/validation-consensus.png index 9269458f65..a9d130a0bc 100644 Binary files a/docs/source/resources/validation-consensus.png and b/docs/source/resources/validation-consensus.png differ diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt index 380ce87ee1..b39948f5b1 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt @@ -108,7 +108,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S override fun track(): DataFeed, SignedTransaction> { return txStorage.exclusive { - DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.bufferUntilSubscribed().wrapWithDatabaseTransaction()) + DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.bufferUntilSubscribed()) } } diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt index 1d69d656c5..a3ddbe6c2b 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt @@ -38,6 +38,7 @@ import net.corda.nodeapi.internal.persistence.contextTransaction import net.corda.nodeapi.internal.persistence.contextTransactionOrNull import org.slf4j.Logger import org.slf4j.LoggerFactory +import org.slf4j.MDC import java.util.concurrent.TimeUnit import kotlin.reflect.KProperty1 @@ -174,11 +175,16 @@ class FlowStateMachineImpl(override val id: StateMachineRunId, } } + fun setLoggingContext() { + context.pushToLoggingContext() + MDC.put("flow-id", id.uuid.toString()) + } + @Suspendable override fun run() { logic.stateMachine = this - context.pushToLoggingContext() + setLoggingContext() initialiseFlow() @@ -331,6 +337,7 @@ class FlowStateMachineImpl(override val id: StateMachineRunId, require(continuation == FlowContinuation.ProcessEvents) Fiber.unparkDeserialized(this, scheduler) } + setLoggingContext() return uncheckedCast(processEventsUntilFlowIsResumed( isDbTransactionOpenOnEntry = false, isDbTransactionOpenOnExit = true