in core/lib/payload/copy.py [0:0]
def compare_checksum(self, old_table_checksum, new_table_checksum):
"""
Given two list of checksum result generated by checksum_by_chunk,
compare whether there's any difference between them
@param old_table_checksum: checksum from old table
@type old_table_checksum: list of list
@param new_table_checksum: checksum from new table
@type new_table_checksum: list of list
"""
if len(old_table_checksum) != len(new_table_checksum):
log.error(
"The total number of checksum chunks mismatch "
"OLD={}, NEW={}".format(
len(old_table_checksum), len(new_table_checksum)
)
)
raise OSCError("CHECKSUM_MISMATCH")
log.info("{} checksum chunks in total".format(len(old_table_checksum)))
for idx, checksum_entry in enumerate(old_table_checksum):
for col in checksum_entry:
if not old_table_checksum[idx][col] == new_table_checksum[idx][col]:
log.error(
"checksum/count mismatch for chunk {} "
"column `{}`: OLD={}, NEW={}".format(
idx,
col,
old_table_checksum[idx][col],
new_table_checksum[idx][col],
)
)
log.error(
"Number of rows for the chunk that cause the "
"mismatch: OLD={}, NEW={}".format(
old_table_checksum[idx]["cnt"],
new_table_checksum[idx]["cnt"],
)
)
log.error(
"Current replayed max(__OSC_ID) of chg table {}".format(
self.last_replayed_id
)
)
raise OSCError("CHECKSUM_MISMATCH")