提交 f6701956 编写于 作者: J Jimmy Yih 提交者: Xin Zhang

Add O_EXCL to MirroredBufferPool_DoOpen create file

This is needed to prevent relations possibly overwriting each
other. The O_EXCL is present in postgres's mdcreate() but for some
reason we don't have it here. This adds it back.
Signed-off-by: NXin Zhang <xzhang@pivotal.io>
上级 1fd11387
......@@ -252,8 +252,9 @@ static void MirroredBufferPool_DoOpen(
*primaryError = 0;
*mirrorDataLossOccurred = false;
/* Using O_EXCL to make it atomic operation to avoid overwriting an existing file. */
if (create)
fileFlags = O_CREAT | O_RDWR | PG_BINARY;
fileFlags = O_CREAT | O_RDWR | O_EXCL | PG_BINARY;
PersistentTablespace_GetPrimaryAndMirrorFilespaces(
relFileNode->spcNode,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册