clp icon indicating copy to clipboard operation
clp copied to clipboard

Timestamp inconsistency before/after compression

Open LinZhihao-723 opened this issue 10 months ago • 0 comments

Bug

When compressing a log event with a large timestamp, the decompressed timestamp is inconsistent with the original one. Before compression: 3924-03-28 10:17:41.891 After compression: 2170-07-29 11:34:00.762 With further explorations, it was believed that this was caused by the execution of the following line: https://github.com/y-scope/clp/blob/c1588526b13da27abeb105c43a62b3b2fdb3a4a2/components/core/src/clp/TimestampPattern.cpp#L733 It seems like the nanosecond precision causes the timestamp overflow; by removing line 737 the bug would be solved.

CLP version

c158852

Environment

macOS 14.2.1

Reproduction steps

echo "3924-03-28 10:17:41.891 This is a message from the future." > test.log
clp c archives test.log
clp x archives out
diff test.log out/test.log

LinZhihao-723 avatar Apr 09 '24 03:04 LinZhihao-723