TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Important PostgreSQL 14 update to avoid silent corruption of indexes

330 点作者 avi_vallarapu将近 3 年前

9 条评论

mattashii将近 3 年前
It is noted in the post, I&#x27;ll repeat it to be clear:<p>This corruption can only occur _during_ a (re)index with CONCURRENTLY specified, on rows that are modified during the reindex operation, and only for that index.<p>No other indexes are impacted, and an index can only be impacted when the updates on the table don&#x27;t update indexed columns.<p>Nevertheless, if you frequently run CIC, you could be having this issue -- right now you can detect the issue with amcheck, and fix it with a non-concurrent REINDEX of the index (yes, this locks the table).<p>Alternatively (not listed in the blog post, but possible if you can&#x27;t afford table locks), you should be able to safely CIC (without corruption) by doing manual snapshot control while concurrently reindexing the index (takes 3 database sessions):<p>In session 1 start a REPEATABLE READ read-only transaction. In session 2, start the concurrent (re)index. In session 3, monitor pg_stat_progress_create_index for session 2 to get to a &#x27;waiting for ...&#x27; phase.<p>When you detect the (re)index session arrives in a waiting phase, start a REPEATABLE READ transaction in this session, and then halt (commit or rollback doesn&#x27;t matter) the transaction in session 1. Now, we switch roles of sessions 1 and 3, and repeat this lock-step while the session that is (re)indexing hasn&#x27;t completed.
评论 #31688854 未加载
评论 #31688377 未加载
评论 #31692354 未加载
msk20将近 3 年前
Looking at the file with changes <a href="https:&#x2F;&#x2F;github.com&#x2F;postgres&#x2F;postgres&#x2F;blob&#x2F;master&#x2F;src&#x2F;backend&#x2F;storage&#x2F;ipc&#x2F;procarray.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;postgres&#x2F;postgres&#x2F;blob&#x2F;master&#x2F;src&#x2F;backend...</a> , I have to say this source code repository is so well documented&#x2F;commented and structured, I really gives you a huge trust in postgres to be used in your stack.
评论 #31688813 未加载
评论 #31692098 未加载
评论 #31688547 未加载
评论 #31688502 未加载
cesarb将近 3 年前
A more official announcement seems to be at <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;165473835807.573551.1512237163040609764%40wrigleys.postgresql.org" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;165473835807.573551.15...</a>
taspeotis将近 3 年前
I think this is the fix: <a href="https:&#x2F;&#x2F;github.com&#x2F;postgres&#x2F;postgres&#x2F;commit&#x2F;e28bb885196916b0a3d898ae4f2be0e38108d81b" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;postgres&#x2F;postgres&#x2F;commit&#x2F;e28bb885196916b0...</a><p>Discussion: <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;17485-396609c6925b982d%40postgresql.org" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;17485-396609c6925b982d...</a>
boiler_up800将近 3 年前
It’s impressive that this is a single revert. That speaks to how the development of Postgres is done atomically.<p>Also not surprised to see it was the EDB team with the expertise to fix it. Their model is a little outdated but they have a lot of experts working there.
评论 #31690545 未加载
optimalsolver将近 3 年前
I&#x27;m running 12.11. Do I need to do anything?
评论 #31692832 未加载
评论 #31692170 未加载
avi_vallarapu将近 3 年前
pg_amcheck can be helpful for validation if its a b-tree index
评论 #31692468 未加载
cfernhout将近 3 年前
Awesome update!
TedShiller将近 3 年前
I love Postgres. But when I look at the bug list of every release it makes me scared. The types of bugs they have are indicative of a poor development process.
评论 #31689262 未加载
评论 #31689155 未加载
评论 #31691853 未加载
评论 #31689233 未加载
评论 #31696916 未加载
评论 #31689030 未加载