diff --git a/services/history-v1/storage/lib/persist_changes.js b/services/history-v1/storage/lib/persist_changes.js index 2ed2742f0c..0b0d8db16b 100644 --- a/services/history-v1/storage/lib/persist_changes.js +++ b/services/history-v1/storage/lib/persist_changes.js @@ -78,6 +78,12 @@ async function persistChanges(projectId, allChanges, limits, clientEndVersion) { let originalEndVersion let changesToPersist + /** + * It's only useful to log validation errors once per flush. When we enforce + * content hash validation, it will stop the flush right away anyway. + */ + let validationErrorLogged = false + limits = limits || {} _.defaults(limits, { changeBucketMinutes: 60, @@ -127,10 +133,13 @@ async function persistChanges(projectId, allChanges, limits, clientEndVersion) { } catch (err) { // Temporary: skip validation errors if (err instanceof InvalidChangeError) { - logger.warn( - { err, projectId }, - 'content snapshot mismatch (ignored)' - ) + if (!validationErrorLogged) { + logger.warn( + { err, projectId }, + 'content snapshot mismatch (ignored)' + ) + validationErrorLogged = true + } } else { throw err }