From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 DDD8145C306 for ; Sun, 13 Dec 2020 21:30:36 +0300 (MSK) References: <59ffd9dd6c9e895b85f89bfb23d6f8fcbf2c556f.1607696813.git.lvasiliev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <8e8dff1a-13fe-b64a-14e3-892f69def428@tarantool.org> Date: Sun, 13 Dec 2020 19:30:34 +0100 MIME-Version: 1.0 In-Reply-To: <59ffd9dd6c9e895b85f89bfb23d6f8fcbf2c556f.1607696813.git.lvasiliev@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 , imeevma@tarantool.org, korablev@tarantool.org, sergos@tarantool.org, m.semkin@corp.mail.ru Cc: tarantool-patches@dev.tarantool.org 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. The patch itself looks good.