-
Notifications
You must be signed in to change notification settings - Fork 683
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
Columnar: fix wraparound bug. #5962
Conversation
1fb9e72
to
c15c8a2
Compare
Codecov Report
@@ Coverage Diff @@
## master #5962 +/- ##
==========================================
- Coverage 92.58% 92.58% -0.01%
==========================================
Files 237 237
Lines 48102 48108 +6
==========================================
+ Hits 44536 44540 +4
- Misses 3566 3568 +2 |
c15c8a2
to
fb22e91
Compare
vac_open_indexes(rel, RowExclusiveLock, &nindexes, &indrels); | ||
vac_close_indexes(nindexes, indrels, NoLock); | ||
|
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.
Should we do someting with indRels ? Since this code currently just opens and closes those indexes.
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.
vac_open_indexes seems() to be skipping invalid indexes, so might be nice to add a test where we vacuum a relation that has an invalid index ?
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.
I changed to use RelationGetIndexList()
instead, which is lighter-weight.
It doesn't look like it's skipping indexes where !indisvalid
... the comment over vac_open_indexes()
says:
* We consider an index vacuumable if it is marked insertable (indisready).
* If it isn't, probably a CREATE INDEX CONCURRENTLY command failed early in
* execution, and what we have is too corrupt to be processable. We will
* vacuum even if the index isn't indisvalid; this is important because in a
* unique index, uniqueness checks will be performed anyway and had better not
* hit dangling index pointers.
If you mean try to test the case where !indisready
, that seems like overkill, unless there's a case I'm missing.
vac_update_relstats(rel, new_rel_pages, new_live_tuples, | ||
new_rel_allvisible, nindexes > 0, | ||
newRelFrozenXid, newRelminMxid, false); | ||
#endif |
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.
should we call pgstat_report_vacuum at some point ?
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.
Yes, done.
We could also improve the logging/instrumentation output, but I'll leave that for another PR.
fb22e91
to
bc528ee
Compare
columnar_vacuum_rel() now advances relfrozenxid. Fixes #5958.
bc528ee
to
a2a947c
Compare
columnar_vacuum_rel() now advances relfrozenxid.
Fixes #5958.
DESCRIPTION: Fix columnar freezing/wraparound bug.