mirror of https://github.com/citusdata/citus.git
Merge pull request #344 from citusdata/fix_shard_lock_acquisition#342
Ensure router executor acquires proper shard lock cr: @onderkalacipull/335/head
commit
8ad5b09251
|
@ -154,7 +154,7 @@ CommutativityRuleToLockMode(CmdType commandType, bool upsertQuery)
|
|||
static void
|
||||
AcquireExecutorShardLock(Task *task, LOCKMODE lockMode)
|
||||
{
|
||||
int64 shardId = task->shardId;
|
||||
int64 shardId = task->anchorShardId;
|
||||
|
||||
LockShardResource(shardId, lockMode);
|
||||
}
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "c.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
#include "distributed/relay_utility.h"
|
||||
#include "distributed/resource_lock.h"
|
||||
#include "storage/lmgr.h"
|
||||
|
||||
|
@ -68,6 +69,8 @@ LockShardResource(uint64 shardId, LOCKMODE lockmode)
|
|||
const bool sessionLock = false;
|
||||
const bool dontWait = false;
|
||||
|
||||
AssertArg(shardId != INVALID_SHARD_ID);
|
||||
|
||||
SET_LOCKTAG_SHARD_RESOURCE(tag, MyDatabaseId, shardId);
|
||||
|
||||
(void) LockAcquire(&tag, lockmode, sessionLock, dontWait);
|
||||
|
|
Loading…
Reference in New Issue