From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 16D12469710 for ; Tue, 26 May 2020 14:11:54 +0300 (MSK) Date: Tue, 26 May 2020 14:11:51 +0300 From: Kirill Yukhin Message-ID: <20200526111151.3x52awj75lzgz4pt@tarantool.org> References: <0f65635ef9ee95131ac0e83b0b70e8c204a322b8.1589968157.git.kyukhin@tarantool.org> <20200523183032.GB2714@atlas> <20200525131354.junz5joymznc6r6j@tarantool.org> <20200525143419.GA33892@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200525143419.GA33892@atlas> Subject: Re: [Tarantool-patches] [PATCH 1/2] Copy DSO module before load instead of symlink-ing List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov , tarantool-patches@dev.tarantool.org Hello, Thanks a lot for your comments. My answers are inlined. On 25 май 17:34, Konstantin Osipov wrote: > * Kirill Yukhin [20/05/25 16:17]: > > Hello, > > > > Thanks a lot fr your inputs. > > > > My answers are inlined. Iterative patch at the bottom. > > I've force pushed updated branch. > > > > On 23 май 21:30, Konstantin Osipov wrote: > > > * Kirill Yukhin [20/05/20 12:54]: > > > > + fclose(source); > > > > + fclose(target); > > > > > > > > > Please use libeio or, as last resort, sendfile(). > > > > > > Tarantool is a single threaded high-performance database and > > > application server. It's not OK to block the event loop for a few > > > hundred thousand instructions (and here we can easily get > > > millions). > > > > As a first try, I took a look @ coio_copyfile(), but it seems > > that we cannot use anything which could yield as the routine > > might be called from within a transaction. > > There is no commitment to allow plugin reload within a > transaction, and I doubt anyone would use it this way. It's a > coincidence - since Vova changed to allow everything which doesn't > yield to run within a transaction, it became allowed. According to code module load occurs on first routine invocation. That means, that it possibly occur inside a transaction. See func_c_call() for details. Hence we are prohibited to yield. > > + off_t pos, left; > > + for (left = st.st_size, pos = 0; left > 0;) { > > + off_t ret = eio_sendfile_sync(dest_fd, source_fd, pos, > > + st.st_size); > > I wonder why do you use eio_sendfile_sync()? Since we cannot yield from within a transaction. > -- > Konstantin Osipov, Moscow, Russia > https://scylladb.com -- Regards, Kirill Yukhin