@@ -304,8 +304,15 @@ private[raft] class RaftActor(
304304 .handleCommittedLogEntriesAndClients { entries =>
305305 entries.foreach {
306306 case (logEntry, Some (client)) =>
307- if (log.isDebugEnabled)
308- log.debug(" === [Leader] committed {} and will notify it to {} ===" , logEntry, client)
307+ if (log.isDebugEnabled) {
308+ log.debug(
309+ s " === [ ${currentState}] Committed event " +
310+ s " (index=[ ${logEntry.index}], term=[ ${logEntry.term.term}], " +
311+ s " entityId=[ ${logEntry.event.entityId.map(_.raw)}], " +
312+ s " type=[ ${logEntry.event.event.getClass.getName}]) " +
313+ s " and sending ReplicationSucceeded to [ $client] === " ,
314+ )
315+ }
309316 client.forward(ReplicationSucceeded (logEntry.event.event, logEntry.index, client.instanceId))
310317 case (logEntry, None ) =>
311318 // 復旧中の commit or リーダー昇格時に未コミットのログがあった場合の commit
@@ -494,11 +501,27 @@ private[raft] class RaftActor(
494501 logEntry.event match {
495502 case EntityEvent (_, NoOp ) => // NoOp は replicationActor には関係ないので転送しない
496503 case EntityEvent (Some (entityId), event) =>
497- if (log.isDebugEnabled) log.debug(" === [{}] applying {} to ReplicationActor ===" , currentState, event)
498- replicationActor(entityId) ! Replica (logEntry)
504+ val targetReplicationActor = replicationActor(entityId)
505+ if (log.isDebugEnabled) {
506+ log.debug(
507+ s " === [ ${currentState}] Sending Replica to apply event " +
508+ s " (index=[ ${logEntry.index}], term=[ ${logEntry.term.term}], " +
509+ s " entityId=[ ${entityId.raw}], " +
510+ s " eventType=[ ${event.getClass.getName}]) " +
511+ s " to ReplicationActor [ $targetReplicationActor] === " ,
512+ )
513+ }
514+ targetReplicationActor ! Replica (logEntry)
499515 case EntityEvent (None , event) =>
500- if (log.isWarningEnabled)
501- log.warning(" === [{}] {} was not applied, because it is not assigned any entity ===" , currentState, event)
516+ if (log.isWarningEnabled) {
517+ log.warning(
518+ " [{}] event [index=[{}], term=[{}], type={}] was not applied, because it is not assigned any entity" ,
519+ currentState,
520+ logEntry.index,
521+ logEntry.term.term,
522+ event.getClass.getName,
523+ )
524+ }
502525 }
503526
504527 def handleSnapshotTick (): Unit = {
0 commit comments