mirror of https://github.com/citusdata/citus.git
Release metadata locks early
parent
7170ed287c
commit
841d25bae9
|
@ -284,8 +284,8 @@ WriteColumnarOptions(Oid regclass, ColumnarOptions *options, bool overwrite)
|
||||||
}
|
}
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
relation_close(columnarOptions, NoLock);
|
relation_close(columnarOptions, RowExclusiveLock);
|
||||||
|
|
||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
@ -335,8 +335,8 @@ DeleteColumnarTableOptions(Oid regclass, bool missingOk)
|
||||||
}
|
}
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
relation_close(columnarOptions, NoLock);
|
relation_close(columnarOptions, RowExclusiveLock);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ ReadColumnarOptions(Oid regclass, ColumnarOptions *options)
|
||||||
Relation index = try_relation_open(ColumnarOptionsIndexRegclass(), AccessShareLock);
|
Relation index = try_relation_open(ColumnarOptionsIndexRegclass(), AccessShareLock);
|
||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
{
|
{
|
||||||
table_close(columnarOptions, NoLock);
|
table_close(columnarOptions, AccessShareLock);
|
||||||
|
|
||||||
/* extension has been dropped */
|
/* extension has been dropped */
|
||||||
return false;
|
return false;
|
||||||
|
@ -394,8 +394,8 @@ ReadColumnarOptions(Oid regclass, ColumnarOptions *options)
|
||||||
}
|
}
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
relation_close(columnarOptions, NoLock);
|
relation_close(columnarOptions, AccessShareLock);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,7 @@ SaveStripeSkipList(RelFileNode relfilenode, uint64 stripe, StripeSkipList *chunk
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishModifyRelation(modifyState);
|
FinishModifyRelation(modifyState);
|
||||||
table_close(columnarChunk, NoLock);
|
table_close(columnarChunk, RowExclusiveLock);
|
||||||
|
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
}
|
}
|
||||||
|
@ -610,8 +610,8 @@ ReadStripeSkipList(RelFileNode relfilenode, uint64 stripe, TupleDesc tupleDescri
|
||||||
}
|
}
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
table_close(columnarChunk, NoLock);
|
table_close(columnarChunk, AccessShareLock);
|
||||||
|
|
||||||
return chunkList;
|
return chunkList;
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ InsertStripeMetadataRow(uint64 storageId, StripeMetadata *stripe)
|
||||||
|
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
|
|
||||||
table_close(columnarStripes, NoLock);
|
table_close(columnarStripes, RowExclusiveLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -849,8 +849,8 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
|
||||||
}
|
}
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
table_close(columnarStripes, NoLock);
|
table_close(columnarStripes, AccessShareLock);
|
||||||
|
|
||||||
return stripeMetadataList;
|
return stripeMetadataList;
|
||||||
}
|
}
|
||||||
|
@ -911,8 +911,8 @@ DeleteMetadataRows(RelFileNode relfilenode)
|
||||||
FinishModifyRelation(modifyState);
|
FinishModifyRelation(modifyState);
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
systable_endscan_ordered(scanDescriptor);
|
||||||
index_close(index, NoLock);
|
index_close(index, AccessShareLock);
|
||||||
table_close(columnarStripes, NoLock);
|
table_close(columnarStripes, AccessShareLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue