timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
16.83k stars 852 forks source link

[Bug]: Invalidation log lowest_modified_value > greatest_modified_value #7098

Open GeorgeTan615 opened 3 days ago

GeorgeTan615 commented 3 days ago

What type of bug is this?

Data corruption, Incorrect result, Unexpected error

What subsystems and features are affected?

Continuous aggregate

What happened?

Hello TimescaleDB team and community, I'm bumping into a case where somehow a continuous aggregate's invalidation log has an entry where lowest_modified_value > greatest_modified_value.

select * from _timescaledb_catalog.continuous_aggs_materialization_invalidation_log where materialization_id=2092;
 materialization_id | lowest_modified_value | greatest_modified_value
--------------------+-----------------------+-------------------------
               2092 |  -9223372036854775808 |        1528446599999999
               2092 |      1720018800000000 |      170925119999999999
               2092 |    170929439100000000 |     9223372036854775807

lowest_modified_value = 1720018800000000 (microseconds, Wednesday, July 3, 2024 3:00:00 PM) greatest_modified_value = 170925119999999999 (nanoseconds, Monday, June 2, 1975 7:12:00 AM)

We don't tamper/directly modify invalidation log tables either. Any idea what could cause this?

TimescaleDB version affected

2.15.2

PostgreSQL version used

15.7

What operating system did you use?

(Debian 15.7-0+deb12u1) on x86_64-pc-linux-gnu

What installation method did you use?

Docker

What platform did you run on?

Other

Relevant log output and stack trace

No response

How can we reproduce the bug?

Not sure how this can reproduced as we have no idea how this is possible.