From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0261545C304 for ; Wed, 16 Dec 2020 17:47:29 +0300 (MSK) Date: Wed, 16 Dec 2020 14:47:28 +0000 From: Nikita Pettik Message-ID: <20201216144728.GA16006@tarantool.org> References: <59ffd9dd6c9e895b85f89bfb23d6f8fcbf2c556f.1607696813.git.lvasiliev@tarantool.org> <8e8dff1a-13fe-b64a-14e3-892f69def428@tarantool.org> <6968e1d8-5bab-d043-ebeb-fc2bbbdea069@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6968e1d8-5bab-d043-ebeb-fc2bbbdea069@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 3/3] sql: update temporary file name format List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy , m.semkin@corp.mail.ru Pushed this patch (not the whole patch-set!) to master, 2.6 and 2.5 branches (CI status was green on the branch). Corresponding changelogs are updated. As a follow-ups I hope to see: - test case (mb with error injections); - #5625; - patch introducing missing diags in SQL OS internals. > Hi! Thank you for the review. > > On 13.12.2020 21:30, Vladislav Shpilevoy wrote: > > Thanks for the patch! > > > > On 11.12.2020 15:49, Leonid Vasiliev via Tarantool-patches wrote: > > > The bug was consisted in fail when working with temporary files > > > created by VDBE to sort large result of a `SELECT` statement with > > > `ORDER BY`, `GROUP BY` clauses. > > > > > > Whats happen (step by step): > > > - We have two instances on one node (sharded cluster). > > > - A query is created that executes on both. > > > - The first instance creates the name of the temporary file and > > > checks a file with such name on existence. > > > - The second instance creates the name of the temporary file > > > (the same as in first instance) and checks a file with such name > > > on existence. > > > - The first instance creates a file with the `SQL_OPEN_DELETEONCLOSE` > > > flag. > > > - The second instance opens(try to open) the same file. > > > - The first instance closes (and removes) the temporary file. > > > - The second instance tries to work with the file and fails. > > > > > > Why did it happen: > > > The temporary file name format has a random part, but the random > > > generator uses a fixed seed. > > > > > > When it was decided to use a fixed seed: > > > 32cb1ad298b2b55d8536a85bdfb3827c8c8739e1 > > > > To reference a commit we also usually include commit title in > > ("...") after the hash. > > Changed to: > > When it was decided to use a fixed seed: > 32cb1ad298b2b55d8536a85bdfb3827c8c8739e1 > ("sql: drop useless code from os_unix.c") > > > > > The patch itself looks good. > >