Source:
<code>void updateAccountsWithAccountMetadataStore(Collection<Account> accounts, AccountMetadataStore accountMetadataStore) throws AccountServiceException { checkOpen(); Objects.requireNonNull(accounts, "accounts cannot be null"); if (accounts.isEmpty()) { throw new IllegalArgumentException("Empty account collection to update."); } if (config.updateDisabled) { throw new AccountServiceException("Updates have been disabled", AccountServiceErrorCode.UpdateDisabled); } if (hasDuplicateAccountIdOrName(accounts)) { accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Duplicate account id or name exist in the accounts to update", AccountServiceErrorCode.ResourceConflict); } long startTimeMs = System.currentTimeMillis(); logger.trace("Start updating to HelixPropertyStore with accounts={}", accounts); boolean hasSucceeded = false; <START> if (accountInfoMapRef.get().hasConflictingAccount(accounts, false)) { <END> logger.debug("Accounts={} conflict with the accounts in local cache. Cancel the update operation.", accounts); accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Input accounts conflict with the accounts in local cache", AccountServiceErrorCode.ResourceConflict); } hasSucceeded = accountMetadataStore.updateAccounts(accounts); long timeForUpdate = System.currentTimeMillis() - startTimeMs; if (hasSucceeded) { logger.trace("Completed updating accounts, took time={} ms", timeForUpdate); accountServiceMetrics.updateAccountTimeInMs.update(timeForUpdate); if (notifier == null) { logger.warn("Notifier is not provided. Cannot notify other entities interested in account data change."); } else if (notifier.publish(ACCOUNT_METADATA_CHANGE_TOPIC, FULL_ACCOUNT_METADATA_CHANGE_MESSAGE)) { logger.trace("Successfully published message for account metadata change"); } else { logger.error("Failed to send notification for account metadata change"); accountServiceMetrics.notifyAccountDataChangeErrorCount.inc(); } } else { logger.error("Failed updating accounts={}, took ms", accounts, timeForUpdate); accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Failed updating accounts to Helix property store", AccountServiceErrorCode.InternalError); } }</code><technical_language>wondering if this a problem switch mysql primary Helix secondary</technical_language>

Target:
void updateAccountsWithAccountMetadataStore(Collection<Account> accounts, AccountMetadataStore accountMetadataStore) throws AccountServiceException { checkOpen(); Objects.requireNonNull(accounts, "accounts cannot be null"); if (accounts.isEmpty()) { throw new IllegalArgumentException("Empty account collection to update."); } if (config.updateDisabled) { throw new AccountServiceException("Updates have been disabled", AccountServiceErrorCode.UpdateDisabled); } if (hasDuplicateAccountIdOrName(accounts)) { accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Duplicate account id or name exist in the accounts to update", AccountServiceErrorCode.ResourceConflict); } long startTimeMs = System.currentTimeMillis(); logger.trace("Start updating to HelixPropertyStore with accounts={}", accounts); boolean hasSucceeded = false; if (accountInfoMapRef.get().hasConflictingAccount(accounts, config.ignoreVersionMismatch)) { logger.debug("Accounts={} conflict with the accounts in local cache. Cancel the update operation.", accounts); accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Input accounts conflict with the accounts in local cache", AccountServiceErrorCode.ResourceConflict); } hasSucceeded = accountMetadataStore.updateAccounts(accounts); long timeForUpdate = System.currentTimeMillis() - startTimeMs; if (hasSucceeded) { logger.trace("Completed updating accounts, took time={} ms", timeForUpdate); accountServiceMetrics.updateAccountTimeInMs.update(timeForUpdate); if (notifier == null) { logger.warn("Notifier is not provided. Cannot notify other entities interested in account data change."); } else if (notifier.publish(ACCOUNT_METADATA_CHANGE_TOPIC, FULL_ACCOUNT_METADATA_CHANGE_MESSAGE)) { logger.trace("Successfully published message for account metadata change"); } else { logger.error("Failed to send notification for account metadata change"); accountServiceMetrics.notifyAccountDataChangeErrorCount.inc(); } } else { logger.error("Failed updating accounts={}, took ms", accounts, timeForUpdate); accountServiceMetrics.updateAccountErrorCount.inc(); throw new AccountServiceException("Failed updating accounts to Helix property store", AccountServiceErrorCode.InternalError); } }