tarantool / tarantool

Get your data in RAM. Get compute close to data. Enjoy the performance.
https://www.tarantool.io
Other
3.4k stars 379 forks source link

wal_mode = "async" #67

Closed pmwkaa closed 1 month ago

pmwkaa commented 10 years ago

With the new architecture of WAL writer, it's way more feasible to implement asynchronous write mode: when clients don't wait for writes to disk. Some of the vendors even pride themselves in this mode (MemSQL), and generally this technique seems to be commonplace on the market (Redis).

If only for one reason, we need this mode to win in the last remaining benchmarks where we may not show off as well as we can.

How to do it:

When this flag is set, allocate struct wal_request on one of two rotating regions, not on fiber->gc, and set it a different route. The route return function should decrement region reference counter, and when the region has no references, it can be garbage collected become available for reuse.

rtsisyk commented 10 years ago

I think it is not so hard to implement. The main problem is where which flag should be provided by the user.

mary3000 commented 3 years ago
  1. It is decided that better to introduce an option to the commit itself (i.e. box.commit({is_async=true})) than to the whole wal. It is more explicit and will not change the behavior of implicit transactions.
  2. As for now, the functionality will be introduced only for transactions. That is, standalone requests in autocommit mode will not have this option.