From: Konstantin Osipov <kostja@tarantool.org> To: tarantool-patches@freelists.org Cc: Georgy Kirichenko <georgy@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v4 4/9] txn: get rid of fiber_gc from txn_rollback Date: Thu, 20 Jun 2019 10:43:18 +0300 [thread overview] Message-ID: <20190620074318.GD15155@atlas> (raw) In-Reply-To: <0eeb7c2b0e45bfae1cba4488292c7d6fc7e69fa4.1560978655.git.georgy@tarantool.org> * Georgy Kirichenko <georgy@tarantool.org> [19/06/20 09:54]: > Don't touch a fiber gc storage on a transaction rollback explicitly. > This relaxes dependencies between fiber and transaction life cycles. As discussed verbally, LGTM. > --- a/src/box/applier.cc > +++ b/src/box/applier.cc > @@ -190,7 +190,7 @@ apply_initial_join_row(struct xrow_header *row) > fiber_gc(); > return rc; > rollback: > - txn_rollback(); > + txn_rollback(txn); > return -1; > } > I weighed your argument that an error leads to diag_raise(), which ends the running fiber, so fiber_gc() is unnecessary. This is true, but don't you think it is a change in the protocol between the caller and the callee? What should be this protocol generally now that we moved most of memory allocation into txn? What should is fiber gc useful for, and should the user always use it with savepoints perhaps? While we're thinking about it and inspecting all of the code to use txn gc if at all possible, please add a comment that fiber_gc() will be called by the caller since we expect the error to abort it. Actually whichever you prefer -a comment or a fiber_gc(). I prefer fiber_gc(), until we replace it with an assert that fiber gc is not used in this function. > @@ -334,7 +336,7 @@ apply_wal_row(struct xstream *stream, struct xrow_header *row) > } > if (box_process_rw(&request, space, NULL) != 0) { > say_error("error applying row: %s", request_str(&request)); > - txn_rollback(); > + txn_rollback(txn); > diag_raise(); the same argument is here. please either add a comment or not change the protocol between the caller and the callee and leave fiber_gc() in place. Tomorrow the error may be suppressed for whatever reason, and we may start having growing garbage on fiber gc pool. Honestly, until we add fiber_gc() to every fiber yield or use another system-wide mechanism to ensure it never grows out of control, I don't think it's safe to remove it from such places. Fusing fiber memory and txn memory had one advantage: we had at leasat some certainty that a fiber which executes transaction will free its memory on a regular basis. Now there is no certainty at all. With these two minor comments the patch is LGTM. -- Konstantin Osipov, Moscow, Russia
next prev parent reply other threads:[~2019-06-20 7:43 UTC|newest] Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-19 21:23 [tarantool-patches] [PATCH v4 0/9] Parallel applier Georgy Kirichenko 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 1/9] txn: handle fiber stop event at transaction level Georgy Kirichenko 2019-06-20 7:28 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 11:39 ` [tarantool-patches] " Vladimir Davydov 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 2/9] core: latch_steal routine Georgy Kirichenko 2019-06-20 7:28 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 11:53 ` [tarantool-patches] " Vladimir Davydov 2019-06-20 20:34 ` Георгий Кириченко 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 3/9] txn: get rid of autocommit from a txn structure Georgy Kirichenko 2019-06-20 7:32 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 11:52 ` [tarantool-patches] " Vladimir Davydov 2019-06-20 20:16 ` Георгий Кириченко 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 4/9] txn: get rid of fiber_gc from txn_rollback Georgy Kirichenko 2019-06-20 7:43 ` Konstantin Osipov [this message] 2019-06-20 20:35 ` [tarantool-patches] " Георгий Кириченко 2019-06-20 13:03 ` [tarantool-patches] " Vladimir Davydov 2019-06-20 20:16 ` Георгий Кириченко 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 5/9] wal: a dedicated wal scheduling fiber Georgy Kirichenko 2019-06-20 7:53 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 13:05 ` [tarantool-patches] " Vladimir Davydov 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 6/9] wal: introduce a journal entry finalization callback Georgy Kirichenko 2019-06-20 7:56 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 14:08 ` [tarantool-patches] " Vladimir Davydov 2019-06-20 20:22 ` Георгий Кириченко 2019-06-21 7:26 ` [tarantool-patches] " Konstantin Osipov 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 7/9] txn: introduce asynchronous txn commit Georgy Kirichenko 2019-06-20 8:01 ` [tarantool-patches] " Konstantin Osipov 2019-06-20 15:00 ` [tarantool-patches] " Vladimir Davydov 2019-06-21 7:28 ` [tarantool-patches] " Konstantin Osipov 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 8/9] applier: apply transaction in parallel Georgy Kirichenko 2019-06-20 7:41 ` [tarantool-patches] " Георгий Кириченко 2019-06-20 8:07 ` Konstantin Osipov 2019-06-20 16:37 ` Vladimir Davydov 2019-06-20 20:33 ` Георгий Кириченко 2019-06-21 8:36 ` Vladimir Davydov 2019-06-20 8:06 ` Konstantin Osipov 2019-06-19 21:23 ` [tarantool-patches] [PATCH v4 9/9] test: fix flaky test Georgy Kirichenko
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190620074318.GD15155@atlas \ --to=kostja@tarantool.org \ --cc=georgy@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v4 4/9] txn: get rid of fiber_gc from txn_rollback' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox