From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (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 421D745C304 for ; Mon, 14 Dec 2020 18:55:00 +0300 (MSK) References: <59ffd9dd6c9e895b85f89bfb23d6f8fcbf2c556f.1607696813.git.lvasiliev@tarantool.org> <8e8dff1a-13fe-b64a-14e3-892f69def428@tarantool.org> From: Leonid Vasiliev Message-ID: <6968e1d8-5bab-d043-ebeb-fc2bbbdea069@tarantool.org> Date: Mon, 14 Dec 2020 18:54:00 +0300 MIME-Version: 1.0 In-Reply-To: <8e8dff1a-13fe-b64a-14e3-892f69def428@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed 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: Vladislav Shpilevoy , imeevma@tarantool.org, korablev@tarantool.org, sergos@tarantool.org, m.semkin@corp.mail.ru Cc: tarantool-patches@dev.tarantool.org 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. >