diff --git a/creator-node/src/services/stateMachineManager/CNodeToSpIdMapManager.js b/creator-node/src/services/stateMachineManager/CNodeToSpIdMapManager.js index cf983dcfda0..5d4e4e9b40c 100644 --- a/creator-node/src/services/stateMachineManager/CNodeToSpIdMapManager.js +++ b/creator-node/src/services/stateMachineManager/CNodeToSpIdMapManager.js @@ -1,4 +1,4 @@ -const { logger } = require('../../logging') +const { logger: genericLogger } = require('../../logging') /** * Queries to periodically keep the mapping of (Content Node endpoint -> SP ID) @@ -29,7 +29,9 @@ class CNodeToSpIdMapManager { cNodeEndpointToSpIdMap[cn.endpoint] = cn.spID }) } catch (e) { - logger.error(`updateCnodeEndpointToSpIdMap Error: ${e.message}`) + genericLogger.error( + `CNodeToSpIdMapManager - Could not fetch content nodes: ${e.message}` + ) } if (Object.keys(cNodeEndpointToSpIdMap).length > 0) { @@ -39,12 +41,14 @@ class CNodeToSpIdMapManager { const mapLength = Object.keys(this.cNodeEndpointToSpIdMap).length if (mapLength === 0) { const errorMessage = - 'updateCnodeEndpointToSpIdMap() Unable to initialize cNodeEndpointToSpIdMap' - logger.error(errorMessage) + 'CNodeToSpIdMapManager - Unable to initialize cNodeEndpointToSpIdMap' + genericLogger.error(errorMessage) throw new Error(errorMessage) } - logger.info(`updateEndpointToSpIdMap Success. Size: ${mapLength}`) + genericLogger.info( + `CNodeToSpIdMapManager - updateCnodeEndpointToSpIdMap Success. Size: ${mapLength}` + ) } } diff --git a/creator-node/src/services/stateMachineManager/stateMonitoring/fetchCNodeEndpointToSpIdMap.jobProcessor.js b/creator-node/src/services/stateMachineManager/stateMonitoring/fetchCNodeEndpointToSpIdMap.jobProcessor.js index b8f88d96abf..ee7e21b42bc 100644 --- a/creator-node/src/services/stateMachineManager/stateMonitoring/fetchCNodeEndpointToSpIdMap.jobProcessor.js +++ b/creator-node/src/services/stateMachineManager/stateMonitoring/fetchCNodeEndpointToSpIdMap.jobProcessor.js @@ -11,7 +11,7 @@ const NodeToSpIdManager = require('../CNodeToSpIdMapManager') module.exports = async function ({ logger }) { let errorMsg = '' try { - NodeToSpIdManager.updateCnodeEndpointToSpIdMap( + await NodeToSpIdManager.updateCnodeEndpointToSpIdMap( QueueInterfacer.getAudiusLibs().ethContracts ) } catch (e) { diff --git a/creator-node/src/services/stateMachineManager/stateMonitoring/findReplicaSetUpdates.jobProcessor.js b/creator-node/src/services/stateMachineManager/stateMonitoring/findReplicaSetUpdates.jobProcessor.js index 1bef6f31f9d..fb307acd0e3 100644 --- a/creator-node/src/services/stateMachineManager/stateMonitoring/findReplicaSetUpdates.jobProcessor.js +++ b/creator-node/src/services/stateMachineManager/stateMonitoring/findReplicaSetUpdates.jobProcessor.js @@ -228,14 +228,18 @@ const _findReplicaSetUpdatesForUser = async ( secondaryInfo.spId }, found ${ CNodeToSpIdMapManager.getCNodeEndpointToSpIdMap()[secondary] - }. Marking replica as unhealthy.` + }. Marking replica as unhealthy. Endpoint to spID mapping: ${JSON.stringify( + CNodeToSpIdMapManager.getCNodeEndpointToSpIdMap() + )}` ) unhealthyReplicas.add(secondary) // Error case 2 - already marked unhealthy } else if (unhealthyPeersSet.has(secondary)) { logger.error( - `_findReplicaSetUpdatesForUser(): Secondary ${secondary} for user ${wallet} in unhealthy peer set. Marking replica as unhealthy.` + `_findReplicaSetUpdatesForUser(): Secondary ${secondary} for user ${wallet} in unhealthy peer set. Marking replica as unhealthy. Endpoint to spID mapping: ${JSON.stringify( + CNodeToSpIdMapManager.getCNodeEndpointToSpIdMap() + )}` ) unhealthyReplicas.add(secondary) @@ -245,7 +249,9 @@ const _findReplicaSetUpdatesForUser = async ( successRate < minSecondaryUserSyncSuccessPercent ) { logger.error( - `_findReplicaSetUpdatesForUser(): Secondary ${secondary} for user ${wallet} has userSyncSuccessRate of ${successRate}, which is below threshold of ${minSecondaryUserSyncSuccessPercent}. ${successCount} Successful syncs vs ${failureCount} Failed syncs. Marking replica as unhealthy.` + `_findReplicaSetUpdatesForUser(): Secondary ${secondary} for user ${wallet} has userSyncSuccessRate of ${successRate}, which is below threshold of ${minSecondaryUserSyncSuccessPercent}. ${successCount} Successful syncs vs ${failureCount} Failed syncs. Marking replica as unhealthy. Endpoint to spID mapping: ${JSON.stringify( + CNodeToSpIdMapManager.getCNodeEndpointToSpIdMap() + )}` ) unhealthyReplicas.add(secondary) }