Commit 5616300
committed
Fix relcache handling of the 'default' partition
My commit 4dba331 that moved around CommandCounterIncrement calls
in partitioning DDL code unearthed a problem with the relcache handling
for the 'default' partition: the construction of a correct relcache
entry for the partitioned table was at the mercy of lack of CCI calls in
non-trivial amounts of code. This was prone to creating problems later
on, as the code develops. This was visible as a test failure in a
compile with RELCACHE_FORCE_RELASE (buildfarm member prion).
The problem is that after the mentioned commit it was possible to create
a relcache entry that had incomplete information regarding the default
partition because I introduced a CCI between adding the catalog entries
for the default partition (StorePartitionBound) and the update of
pg_partitioned_table entry for its parent partitioned table
(update_default_partition_oid). It seems the best fix is to move the
latter so that it occurs inside the former; the purposeful lack of
intervening CCI should be more obvious, and harder to break.
I also remove a check in RelationBuildPartitionDesc that returns NULL if
the key is not set. I couldn't find any place that needs this hack
anymore; probably it was required because of bugs that have since been
fixed.
Fix a few typos I noticed while reviewing the code involved.
Discussion: https://postgr.es/m/20180320182659.nyzn3vqtjbbtfgwq@alvherre.pgsql1 parent e51a048 commit 5616300
3 files changed
+21
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1773 | 1773 | | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | | - | |
| 1776 | + | |
| 1777 | + | |
1777 | 1778 | | |
1778 | 1779 | | |
1779 | 1780 | | |
| |||
3251 | 3252 | | |
3252 | 3253 | | |
3253 | 3254 | | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
3254 | 3258 | | |
3255 | 3259 | | |
3256 | 3260 | | |
| |||
3302 | 3306 | | |
3303 | 3307 | | |
3304 | 3308 | | |
3305 | | - | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
3306 | 3318 | | |
3307 | 3319 | | |
3308 | 3320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 230 | | |
238 | 231 | | |
239 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | 863 | | |
868 | 864 | | |
869 | 865 | | |
| |||
14021 | 14017 | | |
14022 | 14018 | | |
14023 | 14019 | | |
14024 | | - | |
14025 | | - | |
14026 | | - | |
14027 | | - | |
14028 | | - | |
14029 | 14020 | | |
14030 | 14021 | | |
14031 | 14022 | | |
| |||
14286 | 14277 | | |
14287 | 14278 | | |
14288 | 14279 | | |
14289 | | - | |
| 14280 | + | |
14290 | 14281 | | |
14291 | 14282 | | |
14292 | 14283 | | |
| |||
14329 | 14320 | | |
14330 | 14321 | | |
14331 | 14322 | | |
14332 | | - | |
14333 | | - | |
| 14323 | + | |
| 14324 | + | |
| 14325 | + | |
| 14326 | + | |
| 14327 | + | |
| 14328 | + | |
14334 | 14329 | | |
14335 | 14330 | | |
14336 | 14331 | | |
14337 | 14332 | | |
14338 | | - | |
14339 | | - | |
14340 | | - | |
14341 | | - | |
14342 | | - | |
14343 | 14333 | | |
14344 | | - | |
14345 | 14334 | | |
14346 | 14335 | | |
14347 | 14336 | | |
| |||
0 commit comments