static SERIALIZABLEXACT *FirstPredXact(void);
static SERIALIZABLEXACT *NextPredXact(SERIALIZABLEXACT *sxact);
-static bool RWConflictExists(const SERIALIZABLEXACT *reader, const SERIALIZABLEXACT *writer);
+static bool RWConflictExists(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer);
static void SetRWConflict(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer);
static void SetPossibleUnsafeConflict(SERIALIZABLEXACT *roXact, SERIALIZABLEXACT *activeXact);
static void ReleaseRWConflict(RWConflict conflict);
static void SummarizeOldestCommittedSxact(void);
static Snapshot GetSafeSnapshot(Snapshot snapshot);
static Snapshot RegisterSerializableTransactionInt(Snapshot snapshot);
-static bool PredicateLockExists(const PREDICATELOCKTARGETTAG *targettag);
-static bool GetParentPredicateLockTag(const PREDICATELOCKTARGETTAG *tag,
+static bool PredicateLockExists(PREDICATELOCKTARGETTAG *targettag);
+static bool GetParentPredicateLockTag(PREDICATELOCKTARGETTAG *tag,
PREDICATELOCKTARGETTAG *parent);
-static bool CoarserLockCovers(const PREDICATELOCKTARGETTAG *newtargettag);
+static bool CoarserLockCovers(PREDICATELOCKTARGETTAG *newtargettag);
static void RemoveScratchTarget(bool lockheld);
static void RestoreScratchTarget(bool lockheld);
static void RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET *target,
uint32 targettaghash);
-static void DeleteChildTargetLocks(const PREDICATELOCKTARGETTAG *newtargettag);
-static int PredicateLockPromotionThreshold(const PREDICATELOCKTARGETTAG *tag);
-static bool CheckAndPromotePredicateLockRequest(const PREDICATELOCKTARGETTAG *reqtag);
-static void DecrementParentLocks(const PREDICATELOCKTARGETTAG *targettag);
-static void CreatePredicateLock(const PREDICATELOCKTARGETTAG *targettag,
+static void DeleteChildTargetLocks(PREDICATELOCKTARGETTAG *newtargettag);
+static int PredicateLockPromotionThreshold(PREDICATELOCKTARGETTAG *tag);
+static bool CheckAndPromotePredicateLockRequest(PREDICATELOCKTARGETTAG *reqtag);
+static void DecrementParentLocks(PREDICATELOCKTARGETTAG *targettag);
+static void CreatePredicateLock(PREDICATELOCKTARGETTAG *targettag,
uint32 targettaghash,
SERIALIZABLEXACT *sxact);
static void DeleteLockTarget(PREDICATELOCKTARGET *target, uint32 targettaghash);
-static bool TransferPredicateLocksToNewTarget(const PREDICATELOCKTARGETTAG oldtargettag,
- const PREDICATELOCKTARGETTAG newtargettag,
+static bool TransferPredicateLocksToNewTarget(PREDICATELOCKTARGETTAG oldtargettag,
+ PREDICATELOCKTARGETTAG newtargettag,
bool removeOld);
-static void PredicateLockAcquire(const PREDICATELOCKTARGETTAG *targettag);
-static void DropAllPredicateLocksFromTable(const Relation relation,
+static void PredicateLockAcquire(PREDICATELOCKTARGETTAG *targettag);
+static void DropAllPredicateLocksFromTable(Relation relation,
bool transfer);
static void SetNewSxactGlobalXmin(void);
static void ClearOldPredicateLocks(void);
static bool XidIsConcurrent(TransactionId xid);
static void CheckTargetForConflictsIn(PREDICATELOCKTARGETTAG *targettag);
static void FlagRWConflict(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer);
-static void OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader,
+static void OnConflict_CheckForSerializationFailure(SERIALIZABLEXACT *reader,
SERIALIZABLEXACT *writer);
* These functions manage primitive access to the RWConflict pool and lists.
*/
static bool
-RWConflictExists(const SERIALIZABLEXACT *reader, const SERIALIZABLEXACT *writer)
+RWConflictExists(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer)
{
RWConflict conflict;
static uint32
predicatelock_hash(const void *key, Size keysize)
{
- const PREDICATELOCKTAG *predicatelocktag = (const PREDICATELOCKTAG *) key;
+ PREDICATELOCKTAG *predicatelocktag = (PREDICATELOCKTAG *) key;
uint32 targethash;
Assert(keysize == sizeof(PREDICATELOCKTAG));
* Also store it for easy reference in MySerializableXact.
*/
void
-RegisterPredicateLockingXid(const TransactionId xid)
+RegisterPredicateLockingXid(TransactionId xid)
{
SERIALIZABLEXIDTAG sxidtag;
SERIALIZABLEXID *sxid;
* One use is to support proper behavior during GiST index vacuum.
*/
bool
-PageIsPredicateLocked(const Relation relation, const BlockNumber blkno)
+PageIsPredicateLocked(Relation relation, BlockNumber blkno)
{
PREDICATELOCKTARGETTAG targettag;
uint32 targettaghash;
* acceptable!
*/
static bool
-PredicateLockExists(const PREDICATELOCKTARGETTAG *targettag)
+PredicateLockExists(PREDICATELOCKTARGETTAG *targettag)
{
LOCALPREDICATELOCK *lock;
* returns false if none exists.
*/
static bool
-GetParentPredicateLockTag(const PREDICATELOCKTARGETTAG *tag,
+GetParentPredicateLockTag(PREDICATELOCKTARGETTAG *tag,
PREDICATELOCKTARGETTAG *parent)
{
switch (GET_PREDICATELOCKTARGETTAG_TYPE(*tag))
* negative, but it will never return a false positive.
*/
static bool
-CoarserLockCovers(const PREDICATELOCKTARGETTAG *newtargettag)
+CoarserLockCovers(PREDICATELOCKTARGETTAG *newtargettag)
{
PREDICATELOCKTARGETTAG targettag,
parenttag;
* locks.
*/
static void
-DeleteChildTargetLocks(const PREDICATELOCKTARGETTAG *newtargettag)
+DeleteChildTargetLocks(PREDICATELOCKTARGETTAG *newtargettag)
{
SERIALIZABLEXACT *sxact;
PREDICATELOCK *predlock;
* entirely arbitrarily (and without benchmarking).
*/
static int
-PredicateLockPromotionThreshold(const PREDICATELOCKTARGETTAG *tag)
+PredicateLockPromotionThreshold(PREDICATELOCKTARGETTAG *tag)
{
switch (GET_PREDICATELOCKTARGETTAG_TYPE(*tag))
{
* Returns true if a parent lock was acquired and false otherwise.
*/
static bool
-CheckAndPromotePredicateLockRequest(const PREDICATELOCKTARGETTAG *reqtag)
+CheckAndPromotePredicateLockRequest(PREDICATELOCKTARGETTAG *reqtag)
{
PREDICATELOCKTARGETTAG targettag,
nexttag,
* this information is no longer needed.
*/
static void
-DecrementParentLocks(const PREDICATELOCKTARGETTAG *targettag)
+DecrementParentLocks(PREDICATELOCKTARGETTAG *targettag)
{
PREDICATELOCKTARGETTAG parenttag,
nexttag;
* PredicateLockAcquire for that.
*/
static void
-CreatePredicateLock(const PREDICATELOCKTARGETTAG *targettag,
+CreatePredicateLock(PREDICATELOCKTARGETTAG *targettag,
uint32 targettaghash,
SERIALIZABLEXACT *sxact)
{
* any finer-grained locks covered by the new one.
*/
static void
-PredicateLockAcquire(const PREDICATELOCKTARGETTAG *targettag)
+PredicateLockAcquire(PREDICATELOCKTARGETTAG *targettag)
{
uint32 targettaghash;
bool found;
* Clear any finer-grained predicate locks this session has on the relation.
*/
void
-PredicateLockRelation(const Relation relation, const Snapshot snapshot)
+PredicateLockRelation(Relation relation, Snapshot snapshot)
{
PREDICATELOCKTARGETTAG tag;
* Clear any finer-grained predicate locks this session has on the relation.
*/
void
-PredicateLockPage(const Relation relation, const BlockNumber blkno,
- const Snapshot snapshot)
+PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot)
{
PREDICATELOCKTARGETTAG tag;
* Skip if this is a temporary table.
*/
void
-PredicateLockTuple(const Relation relation, const HeapTuple tuple,
- const Snapshot snapshot)
+PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot)
{
PREDICATELOCKTARGETTAG tag;
ItemPointer tid;
* Caller must hold SerializablePredicateLockListLock.
*/
static bool
-TransferPredicateLocksToNewTarget(const PREDICATELOCKTARGETTAG oldtargettag,
- const PREDICATELOCKTARGETTAG newtargettag,
+TransferPredicateLocksToNewTarget(PREDICATELOCKTARGETTAG oldtargettag,
+ PREDICATELOCKTARGETTAG newtargettag,
bool removeOld)
{
uint32 oldtargettaghash;
* transaction which executed DROP TABLE, the false condition will be useful.
*/
static void
-DropAllPredicateLocksFromTable(const Relation relation, bool transfer)
+DropAllPredicateLocksFromTable(Relation relation, bool transfer)
{
HASH_SEQ_STATUS seqstat;
PREDICATELOCKTARGET *oldtarget;
* relation to a single relation lock on the heap.
*/
void
-TransferPredicateLocksToHeapRelation(const Relation relation)
+TransferPredicateLocksToHeapRelation(Relation relation)
{
DropAllPredicateLocksFromTable(relation, true);
}
* which hold the locks getting in and noticing.
*/
void
-PredicateLockPageSplit(const Relation relation, const BlockNumber oldblkno,
- const BlockNumber newblkno)
+PredicateLockPageSplit(Relation relation, BlockNumber oldblkno,
+ BlockNumber newblkno)
{
PREDICATELOCKTARGETTAG oldtargettag;
PREDICATELOCKTARGETTAG newtargettag;
* occurs in the context of another transaction isolation level.
*/
void
-PredicateLockPageCombine(const Relation relation, const BlockNumber oldblkno,
- const BlockNumber newblkno)
+PredicateLockPageCombine(Relation relation, BlockNumber oldblkno,
+ BlockNumber newblkno)
{
/*
* Page combines differ from page splits in that we ought to be able to
* holding locks.
*/
void
-ReleasePredicateLocks(const bool isCommit)
+ReleasePredicateLocks(bool isCommit)
{
bool needToClear;
RWConflict conflict,
* currently no known reason to call this function from an index AM.
*/
void
-CheckForSerializableConflictOut(const bool visible, const Relation relation,
- const HeapTuple tuple, const Buffer buffer,
- const Snapshot snapshot)
+CheckForSerializableConflictOut(bool visible, Relation relation,
+ HeapTuple tuple, Buffer buffer,
+ Snapshot snapshot)
{
TransactionId xid;
SERIALIZABLEXIDTAG sxidtag;
* tuple itself.
*/
void
-CheckForSerializableConflictIn(const Relation relation, const HeapTuple tuple,
- const Buffer buffer)
+CheckForSerializableConflictIn(Relation relation, HeapTuple tuple,
+ Buffer buffer)
{
PREDICATELOCKTARGETTAG targettag;
* lead to some false positives, but it doesn't seem worth the trouble.)
*/
void
-CheckTableForSerializableConflictIn(const Relation relation)
+CheckTableForSerializableConflictIn(Relation relation)
{
HASH_SEQ_STATUS seqstat;
PREDICATELOCKTARGET *target;
*----------------------------------------------------------------------------
*/
static void
-OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader,
+OnConflict_CheckForSerializationFailure(SERIALIZABLEXACT *reader,
SERIALIZABLEXACT *writer)
{
bool failure;
extern void CheckPointPredicate(void);
/* predicate lock reporting */
-extern bool PageIsPredicateLocked(const Relation relation, const BlockNumber blkno);
+extern bool PageIsPredicateLocked(Relation relation, BlockNumber blkno);
/* predicate lock maintenance */
extern Snapshot RegisterSerializableTransaction(Snapshot snapshot);
-extern void RegisterPredicateLockingXid(const TransactionId xid);
-extern void PredicateLockRelation(const Relation relation, const Snapshot snapshot);
-extern void PredicateLockPage(const Relation relation, const BlockNumber blkno, const Snapshot snapshot);
-extern void PredicateLockTuple(const Relation relation, const HeapTuple tuple, const Snapshot snapshot);
-extern void PredicateLockPageSplit(const Relation relation, const BlockNumber oldblkno, const BlockNumber newblkno);
-extern void PredicateLockPageCombine(const Relation relation, const BlockNumber oldblkno, const BlockNumber newblkno);
-extern void TransferPredicateLocksToHeapRelation(const Relation relation);
-extern void ReleasePredicateLocks(const bool isCommit);
+extern void RegisterPredicateLockingXid(TransactionId xid);
+extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
+extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
+extern void PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot);
+extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
+extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
+extern void TransferPredicateLocksToHeapRelation(Relation relation);
+extern void ReleasePredicateLocks(bool isCommit);
/* conflict detection (may also trigger rollback) */
-extern void CheckForSerializableConflictOut(const bool valid, const Relation relation, const HeapTuple tuple,
- const Buffer buffer, const Snapshot snapshot);
-extern void CheckForSerializableConflictIn(const Relation relation, const HeapTuple tuple, const Buffer buffer);
-extern void CheckTableForSerializableConflictIn(const Relation relation);
+extern void CheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
+ Buffer buffer, Snapshot snapshot);
+extern void CheckForSerializableConflictIn(Relation relation, HeapTuple tuple, Buffer buffer);
+extern void CheckTableForSerializableConflictIn(Relation relation);
/* final rollback checking */
extern void PreCommit_CheckForSerializationFailure(void);