From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9FD5F222E8 for ; Wed, 18 Jul 2018 07:52:54 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pnedq47bYjuJ for ; Wed, 18 Jul 2018 07:52:54 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5D779222C1 for ; Wed, 18 Jul 2018 07:52:54 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 3/7] box: create new methods for ephemeral spaces References: From: Kirill Shcherbatov Message-ID: Date: Wed, 18 Jul 2018 14:52:52 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Mergen Imeev > /** > + * Fill up request according to given > + * operation type. For all cases but > + * UPSERT argument name match names of > + * fields of struct request. For UPSERT > + * arguments key and key_end are fields > + * ops and ops_end. > + */ 1. Please, write doxygen-style comment with right margin 66. The other nitpicks are similar: you should be at least consistent with functions comments: I mean, memtx_space_ephemeral_replace has _invalid_ comment, but at the same time memtx_space_execute_upsert doesn't have comment at all. Please, clean-up this by your own. > +memtx_space_ephemeral_replace(struct space *space, struct txn *txn, > + struct request *request, struct tuple **result) > { > - struct memtx_space *memtx_space = (struct memtx_space *)space; > - struct tuple *new_tuple = memtx_tuple_new(space->format, tuple, > - tuple_end); > - if (new_tuple == NULL) > - return -1; > - tuple_ref(new_tuple); > + assert(txn == NULL); > + (void)txn; > + struct tuple *new_tuple = NULL; > struct tuple *old_tuple = NULL; > - if (memtx_space->replace(space, old_tuple, new_tuple, > - DUP_REPLACE_OR_INSERT, &old_tuple) != 0) { > + int rc = memtx_space_replace_impl(space, request, &new_tuple, > + &old_tuple, result); > + if (rc && new_tuple != NULL) 2. rc != 0 3. Looks like you introduce interesting functional changes. They deserve to be tested, don't you think? Or there is no way to test this new API yet? I don't insist on C-module tests if this the only way to test it.