-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix race condition when creating CAgg #6001
Fix race condition when creating CAgg #6001
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6001 +/- ##
==========================================
- Coverage 81.53% 81.53% -0.01%
==========================================
Files 246 246
Lines 56581 56539 -42
Branches 12537 12519 -18
==========================================
- Hits 46135 46099 -36
+ Misses 8085 8051 -34
- Partials 2361 2389 +28
... and 45 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
adcc62f
to
7b2390f
Compare
307913b
to
60b6a27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably have a better commit message and consider if a test needs to be added. Otherwise, I see no problems with this patch.
60b6a27
to
2a5a970
Compare
Done! |
@svenklemm, @mahipv: please review this pull request.
|
6a43979
to
4c986d3
Compare
4c986d3
to
3b2e592
Compare
3b2e592
to
0a4b43c
Compare
Creating one or more Continuous Aggregates over the same hypertable concurrently in different sessions lead to a race condition on checking for the existance of the trigger `ts_cagg_invalidation_trigger`. Fixed it by using the `OR REPLACE` option for the `CREATE TRIGGER` statement introduced in PG14 and for prior versions taking an `ShareUpdateExclusiveLock` and holding it until the end of the transaction when checking the trigger existance in the `check_trigger_exists_hypertable` function.
0a4b43c
to
3f4ccd6
Compare
Creating one or more Continuous Aggregates over the same hypertable
concurrently in different sessions lead to a race condition on checking
for the existance of the trigger
ts_cagg_invalidation_trigger
.Fixed it by using the
OR REPLACE
option for theCREATE TRIGGER
statement introduced in PG14 and for prior versions taking an
ShareUpdateExclusiveLock
and holding it until the end of thetransaction when checking the trigger existance in the
check_trigger_exists_hypertable
function.Disable-check: force-changelog-file