[patches] [PATCH] Don't try to lock a ddl latch in a multistatement tx

Georgy Kirichenko georgy at tarantool.org
Fri Mar 2 08:43:18 MSK 2018


This behavior is prohibited, nothing was changed

On Thursday, March 1, 2018 5:53:26 PM MSK Vladimir Davydov wrote:
> On Thu, Mar 01, 2018 at 05:12:40PM +0300, Georgy Kirichenko wrote:
> > Any ddl is prohibited in a multistatement transaction, there is no
> > reason to try to lock a ddl latch in tis case. Locking for already
> > locked latch will cause an yield and a silent transaction rollback, and
> > this will crash or assert tarantool server.
> > 
> > Fixes #2783
> > 
> > diff --git a/src/box/alter.cc b/src/box/alter.cc
> > index 5749740d2..b94cf710b 100644
> > --- a/src/box/alter.cc
> > +++ b/src/box/alter.cc
> > @@ -3133,6 +3133,13 @@ lock_before_dd(struct trigger *trigger, void
> > *event)
> > 
> >  	if (fiber() == latch_owner(&schema_lock))
> >  	
> >  		return;
> >  	
> >  	struct txn *txn = (struct txn *)event;
> > 
> > +	/*
> > +	 * The trigger is executed before any check and may yield but
> > +	 * an yield in a non-autocommit memtx transaction will rollback it.
> > +	 * So we shouldn't to try to lock a latch if there is a multistatement
> > +	 * transaction.
> > +	 */
> > +	txn_check_singlestatement_xc(txn, "DDL");
> 
> This check will raise even if the transaction has no statements at all
> so the following code will fail:
> 
>   box.begin()
>   box.schema.space.create('test')
>   box.commit()
> 
> AFAIK this will break our SQL implementation.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180302/8f38ae68/attachment.sig>


More information about the Tarantool-patches mailing list