[tarantool-patches] Re: [PATCH 1/2] Introduce a txn memory region

Konstantin Osipov kostja at tarantool.org
Wed Apr 10 13:11:48 MSK 2019


* Georgy Kirichenko <georgy at tarantool.org> [19/04/10 10:26]:
> Attach a separate memory region for each txn structure in order to store
> all txn internal data until the transaction finished. This patch is a
> preparation to detach a txn from a fiber and a fiber gc storage.

The patch is OK as the first patch on the stack, I hope most of
the allocations will begin using txn region in subsequent patches.

A few minor comments:
- let's use a single linked list, unless there is a good reason to
  use a double linked list
- let's preserve THRASH, or maybe there is already thrash in
  region_free?
- it's good we use sizeof(txn) in region_truncate(), but let's
  assert that region_alloc() does use sizeof(txn) and doesn't
  align it in any way.
- I would not add txn_new/txn_free as separate methods, they are
  not useful on their own
- I thought we already have ER_NO_ACTIVE_TRANSACTION error, but
  found we don't. We have ER_SAVEPOINT_NO_TRANSACTION though.
  Perhaps we could make it more generic? Well, your choice is good
  enough, but then again, maybe make *it* generic?

  E.g., could we perhaps make the message like this:

  Can not %s when there is no active transaction.

  We could even rename ER_SAVEPOINT_NO_TRANSACTION, change the
  error message to one with a placeholder and reuse it.
  What do you think?


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list