mirror of https://github.com/citusdata/citus.git
Merge branch 'master' into velioglu/table_wo_seq_prototype
commit
a9a6807245
|
@ -187,17 +187,17 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId)
|
|||
phdr->pd_lower += sizeof(ColumnarMetapage);
|
||||
|
||||
PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO);
|
||||
smgrwrite(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||
COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||
|
||||
/* write empty page */
|
||||
PageInit(page, BLCKSZ, 0);
|
||||
|
||||
PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO);
|
||||
smgrwrite(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||
COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||
|
||||
/*
|
||||
* An immediate sync is required even if we xlog'd the page, because the
|
||||
|
|
|
@ -350,22 +350,6 @@ ReplicateReferenceTableShardToNode(ShardInterval *shardInterval, char *nodeName,
|
|||
List *ddlCommandList =
|
||||
CopyShardCommandList(shardInterval, srcNodeName, srcNodePort, includeData);
|
||||
|
||||
List *shardPlacementList = ShardPlacementListIncludingOrphanedPlacements(shardId);
|
||||
ShardPlacement *targetPlacement = SearchShardPlacementInList(shardPlacementList,
|
||||
nodeName, nodePort);
|
||||
if (targetPlacement != NULL)
|
||||
{
|
||||
if (targetPlacement->shardState == SHARD_STATE_ACTIVE)
|
||||
{
|
||||
/* We already have the shard, nothing to do */
|
||||
return;
|
||||
}
|
||||
ereport(ERROR, (errmsg(
|
||||
"Placement for reference table \"%s\" on node %s:%d is not active. This should not be possible, please report this as a bug",
|
||||
get_rel_name(shardInterval->relationId), nodeName,
|
||||
nodePort)));
|
||||
}
|
||||
|
||||
ereport(NOTICE, (errmsg("Replicating reference table \"%s\" to the node %s:%d",
|
||||
get_rel_name(shardInterval->relationId), nodeName,
|
||||
nodePort)));
|
||||
|
@ -573,6 +557,20 @@ ReplicateAllReferenceTablesToNode(WorkerNode *workerNode)
|
|||
List *shardIntervalList = LoadShardIntervalList(referenceTableId);
|
||||
ShardInterval *shardInterval = (ShardInterval *) linitial(shardIntervalList);
|
||||
|
||||
List *shardPlacementList =
|
||||
ShardPlacementListIncludingOrphanedPlacements(shardInterval->shardId);
|
||||
ShardPlacement *targetPlacement =
|
||||
SearchShardPlacementInList(shardPlacementList,
|
||||
workerNode->workerName,
|
||||
workerNode->workerPort);
|
||||
if (targetPlacement != NULL &&
|
||||
targetPlacement->shardState == SHARD_STATE_ACTIVE)
|
||||
{
|
||||
/* We already have the shard, nothing to do */
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
referenceShardIntervalList = lappend(referenceShardIntervalList,
|
||||
shardInterval);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue