Merge branch 'master' into velioglu/table_wo_seq_prototype

velioglu/temp_two_pro
Burak Velioglu 2022-01-31 15:58:35 +03:00
commit a9a6807245
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
2 changed files with 16 additions and 18 deletions

View File

@ -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

View File

@ -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);
}