Commit 1f898f7
committed
fix(operator): un-gate readiness on needs-reindex-all, revert to blind REINDEX DATABASE
The amcheck-driven smart pass introduced in #68 hits the same family
of postgres-internal pathology that wedges other vanilla DDL on the
prod dataset — bt_index_check itself burns 100% CPU forever on
specific indexes (observed via pg_stat_activity: state=active,
empty wait_event, query_start growing linearly with wall clock for
4+ minutes on a tiny system catalog index). The smart pass is
unusable on this data.
Two changes:
1. Drop bt_index_check; revert the needs-reindex-all branch to blind
REINDEX DATABASE per user DB. REINDEX reads the heap and rebuilds
the index from scratch — different code path from amcheck, which
reads corrupt index pages directly — so it isn't subject to the
same wedge. Slow (hours on prod-sized DBs) but makes progress.
2. Drop the readiness probe's gate on /pgdata/needs-reindex-all. With
the reindex taking hours, gating readiness here trips the
operator's 30-minute deployment_ready_timeout and the restore is
marked Failed before postgres even has a chance to come up. The
probe still gates on /pgdata/needs-reindex (locale-only,
finishes in seconds) since that's small and proven.
Trade-off: clients hitting a not-yet-reindexed corrupt index between
pod-Ready and reindex-complete get the explicit "unexpected zero
page" error, retry, succeed once the rebuild lands. Strictly better
than the alternative (permanently failed restore, replica stuck
indefinitely on the previous Active).
The pre-#68 behaviour for the locale-only path is unchanged.1 parent 98e1000 commit 1f898f7
2 files changed
Lines changed: 54 additions & 100 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1257 | 1261 | | |
1258 | | - | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1264 | 1267 | | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1273 | 1276 | | |
1274 | 1277 | | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
| 1278 | + | |
| 1279 | + | |
1325 | 1280 | | |
1326 | 1281 | | |
1327 | 1282 | | |
| |||
1397 | 1352 | | |
1398 | 1353 | | |
1399 | 1354 | | |
1400 | | - | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1401 | 1364 | | |
1402 | 1365 | | |
1403 | 1366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
750 | 749 | | |
751 | 750 | | |
752 | 751 | | |
| |||
770 | 769 | | |
771 | 770 | | |
772 | 771 | | |
773 | | - | |
774 | | - | |
| 772 | + | |
| 773 | + | |
775 | 774 | | |
776 | 775 | | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
| 776 | + | |
| 777 | + | |
791 | 778 | | |
792 | 779 | | |
793 | 780 | | |
| |||
796 | 783 | | |
797 | 784 | | |
798 | 785 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
804 | 795 | | |
805 | 796 | | |
806 | 797 | | |
| |||
826 | 817 | | |
827 | 818 | | |
828 | 819 | | |
829 | | - | |
830 | | - | |
| 820 | + | |
| 821 | + | |
831 | 822 | | |
832 | 823 | | |
833 | | - | |
834 | | - | |
| 824 | + | |
| 825 | + | |
835 | 826 | | |
836 | 827 | | |
837 | 828 | | |
| |||
0 commit comments