提交 c7d0ee16 编写于 作者: J Jacob Champion 提交者: Asim RP

CreateFakeRelcacheEntry: remove dead standby-filespace code

The directory creation code here seems to be duplicated in multiple
places. Since tests are passing now, we're not sure if it's necessary.
It seems to only apply to a standby master, when using non-default
filespaces, and we haven't found a good test case to reproduce the
initial issue that it was supposed to solve -- it seems like originally,
there was a problem where the filespace hashtable was not initialized on
the standby.

Since things seem to be working as intended now, get rid of the dead
code.
Signed-off-by: NJacob Champion <pchampion@pivotal.io>
Signed-off-by: NAsim R P <apraveen@pivotal.io>
上级 ea7eabb0
......@@ -444,97 +444,6 @@ CreateFakeRelcacheEntry(RelFileNode rnode)
rel->rd_rel = &fakeentry->pgc;
rel->rd_node = rnode;
/* GPDB_84_MERGE_FIXME: this if block was moved from the removed
* XLogOpenRelation(). Is this the correct place for it? What does it do?
*/
#if 0
/*
* We need to fault in the database directory on the standby.
*/
if (rnode.spcNode != GLOBALTABLESPACE_OID && IsStandbyMode())
{
char *primaryFilespaceLocation = NULL;
char *dbPath;
if (IsBuiltinTablespace(rnode.spcNode))
{
/*
* No filespace to fetch.
*/
}
else
{
char *mirrorFilespaceLocation = NULL;
/*
* Investigate whether the containing directories exist to give more detail.
*/
PersistentTablespace_GetPrimaryAndMirrorFilespaces(
rnode.spcNode,
&primaryFilespaceLocation,
&mirrorFilespaceLocation);
if (primaryFilespaceLocation == NULL ||
strlen(primaryFilespaceLocation) == 0)
{
elog(ERROR, "Empty primary filespace directory location");
}
if (mirrorFilespaceLocation != NULL)
{
pfree(mirrorFilespaceLocation);
mirrorFilespaceLocation = NULL;
}
}
dbPath = (char*)palloc(MAXPGPATH + 1);
FormDatabasePath(
dbPath,
primaryFilespaceLocation,
rnode.spcNode,
rnode.dbNode);
if (primaryFilespaceLocation != NULL)
{
pfree(primaryFilespaceLocation);
primaryFilespaceLocation = NULL;
}
if (mkdir(dbPath, 0700) == 0)
{
if (Debug_persistent_recovery_print)
{
elog(PersistentRecovery_DebugPrintLevel(),
"XLogOpenRelation: Re-created database directory \"%s\"",
dbPath);
}
}
else
{
/*
* Allowed to already exist.
*/
if (errno != EEXIST)
{
elog(ERROR, "could not create database directory \"%s\": %m",
dbPath);
}
else
{
if (Debug_persistent_recovery_print)
{
elog(PersistentRecovery_DebugPrintLevel(),
"XLogOpenRelation: Database directory \"%s\" already exists",
dbPath);
}
}
}
pfree(dbPath);
}
#endif
/* We don't know the name of the relation; use relfilenode instead */
sprintf(RelationGetRelationName(rel), "%u", rnode.relNode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册