From 2f9c0b7a36a433078b6db3c0a7a94ee1b4de2f58 Mon Sep 17 00:00:00 2001 From: Petr Jelinek Date: Sun, 12 Apr 2015 22:00:35 +0200 Subject: [PATCH] Correct lock level in filter_AlterTableStmt() --- bdr_commandfilter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bdr_commandfilter.c b/bdr_commandfilter.c index 4c550875f5..57184ac53f 100644 --- a/bdr_commandfilter.c +++ b/bdr_commandfilter.c @@ -179,13 +179,11 @@ filter_AlterTableStmt(Node *parsetree, hasInvalid = false; /* - * XXX: Is NoLock sufficient? It should be as we don't allow concurrent - * DDL in BDR at all at the moment. - * * Can't use AlterTableGetLockLevel(astmt->cmds); * Otherwise we deadlock between the global DDL locks and DML replay. + * ShareUpdateExclusiveLock should be enough to block DDL but not DML. */ - lockmode = NoLock; + lockmode = ShareUpdateExclusiveLock; relid = AlterTableLookupRelation(astmt, lockmode); stmts = transformAlterTableStmt(relid, astmt, queryString); -- 2.39.5