Fix relfilenode conflicts.
There was a race condition in the way relfilenodes were chosen, because QE nodes chose relfilenodes for existing relations, e.g. at REINDEX or TRUNCATE, independently of the master, while for newly created tables, the relfilenode was chosen by the master. To fix: 1. If the OID of a newly-created table is already in use as relfilenode of a different table in a QE segment, use a different relfilenode. (This shouldn't happen in the dispatcher, for the same reasons it cannot happen in a single-server PostgreSQL instance) 2. Use a small cache of values recently used for a relfilenode, to close a race condition between checking if a relfilenode is in use, and actually creating the file
Showing
想要评论请 注册 或 登录