Skip to content

Commit

Permalink
Clarify the comment for invalidation threshold
Browse files Browse the repository at this point in the history
Explicitly state that the invalidation threshold is ignored by the transactions
that use an isolation level above READ COMMITTED.
  • Loading branch information
afiskon authored and Aleksander Alekseev committed Oct 14, 2021
1 parent 3729c50 commit cb13754
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tsl/src/continuous_aggs/invalidation_threshold.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* amplification in "hot" regions---typically the "head" of the table. The
* presumption is that most inserts happen at recent time intervals, and those
* intervals will be invalid until writes move out of them. Therefore, it
* isnt't worth writing invalidations in that region since it is presumed
* isn't worth writing invalidations in that region since it is presumed
* out-of-date anyway. Further, although it is possible to refresh a
* continuous aggregate in those "hot" regions, it will lead to partially
* filled buckets. Thus, refreshing those intervals is discouraged since the
Expand All @@ -43,7 +43,7 @@
* the threshold but not after it.
*
* The invalidation threshold is moved forward (and only forward) by refreshes
* on continuous aggregates when it covers a window that streches beyond the
* on continuous aggregates when it covers a window that stretches beyond the
* current threshold. The invalidation threshold needs to be moved in its own
* transaction, with exclusive access, before the refresh starts to
* materialize data. This is to avoid losing any invalidations that occur
Expand All @@ -57,6 +57,11 @@
* |
* invalidation threshold
*
* Transactions that use an isolation level stronger than READ COMMITTED will
* not be able to "see" changes to the invalidation threshold that may have
* been made while they were running. Therefore, they always create records
* in the hypertable invalidation log. See the cache_inval_entry_write()
* implementation in tsl/src/continuous_aggs/insert.c
*/

typedef struct InvalidationThresholdData
Expand Down

0 comments on commit cb13754

Please sign in to comment.