mirror of https://github.com/citusdata/citus.git
* Set table size to zero if no size is read
* Add comment to relation size bug fix
(cherry picked from commit 5115100db0
)
pull/5098/head
parent
f8e06fb1ed
commit
4a904e070d
|
@ -644,7 +644,19 @@ DistributedTableSizeOnWorker(WorkerNode *workerNode, Oid relationId,
|
||||||
StringInfo tableSizeStringInfo = (StringInfo) linitial(sizeList);
|
StringInfo tableSizeStringInfo = (StringInfo) linitial(sizeList);
|
||||||
char *tableSizeString = tableSizeStringInfo->data;
|
char *tableSizeString = tableSizeStringInfo->data;
|
||||||
|
|
||||||
*tableSize = SafeStringToUint64(tableSizeString);
|
if (strlen(tableSizeString) > 0)
|
||||||
|
{
|
||||||
|
*tableSize = SafeStringToUint64(tableSizeString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This means the shard is moved or dropped while citus_total_relation_size is
|
||||||
|
* being executed. For this case we get an empty string as table size.
|
||||||
|
* We can take that as zero to prevent any unnecessary errors.
|
||||||
|
*/
|
||||||
|
*tableSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
PQclear(result);
|
PQclear(result);
|
||||||
ClearResults(connection, failOnError);
|
ClearResults(connection, failOnError);
|
||||||
|
|
Loading…
Reference in New Issue