Skip to content

Commit

Permalink
Fix for duplicate writing in test mode (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
jphui authored Sep 17, 2024
1 parent af0995a commit 90206c8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,12 @@ protected <ASPECT extends RecordTemplate> void insert(@Nonnull URN urn, @Nullabl
_localAccess.add(urn, (ASPECT) value, aspectClass, auditStamp, trackingContext, isTestMode);
}

if (_changeLogEnabled) {
// skip appending change log table (metadata_aspect) if not enabled
// DO append change log table (metadata_aspect) if:
// 1. explicitly enabled
// AND
// 2. if NOT in test mode
// -> which is ALWAYS a dual-write operation (meaning this insertion will already happen in the "other" write)
if (_changeLogEnabled && !isTestMode) {
_server.insert(aspect);
}
}
Expand Down

0 comments on commit 90206c8

Please sign in to comment.