Commit Briefs

7a1a2249a4 Sergey Bronnikov

test: add additional tests for a strptime() (ligurio/gh-8588-test-strptime)

The testsuite "Datetime string parsing by format (detailed)" tests parsing of a string with various conversion specifications. However, `tostring(dt)` is used as a test oracle, and all these testcases do not test some conversion specifications at all because the metamethod `__tostring` for the datetime object uses `:format()` with the default format string. Due to missed tests for conversion specifications, the behavior described in #10470 was missed: ``` tarantool> dt = date.parse('Mon', {format = '%a'}) tarantool> dt --- - 1970-01-01T00:00:00Z ... tarantool> dt:format('%a') --- - Thu ... ``` The patch adds tests for `strptime` with all possible conversion specifications described in strftime(3) [1][2]. 1. https://man.freebsd.org/cgi/man.cgi?strftime(3) 2. https://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html Follows up #8588 Follows up #6731 Relates to #10470 NO_CHANGELOG=testing NO_DOC=testing


507390413c Sergey Bronnikov

test: check a number of parsed characters

The patch adds additional assertions for a number of characters parsed by `datetime.parse()`. Follows up #6731 NO_CHANGELOG=codehealth NO_DOC=codehealth


49e459ea9b Serge Petrenko

memtx: accelerate count in the tree

Prior to this patch the count request had been performed in the memtx in a straightforward way: we created an iterator by a type and key and simply called its `next` method until it's exhausted. That means the operation had a linear complexity, which could lead to DoS situations. Also the count operation with ALL iterator hadn't been recorded in the MVCC previously and had an erroneous logic (see the #10140). This is fixed too as a side effect. This patch makes the memtx tree index use a version of BPS tree with the cardinality information enabled and takes advantage of its offset based API to implement the count operation using tree lookups. Since the method does not read each counted tuple now, MVCC subsystem would be unaware of it. In order to fix this, this patch introduces a new entity in the memtx transaction manager to track such operations: GAP_COUNT, and the corresponding `memtx_tx_track_count` function. The entity (gap item) is a record that a concurrent transaction has counted tuples matching some key and iterator type in an index. If a transaction creates such an entity, any insertion or deletion of a matching tuple in the index will be conflicted with it. This works differently for inserts and deletes: 1. If a concurrent transaction inserts a new matching tuple, then its read_gaps list is modified like the counted transaction had read the exact key of the tuple and found nothing. This creates a conflict. 2. If a concurrent transaction deletes a matching tuple, then the transaction that counted the tuple is inserted into the tuple reader list: it pretends to have read the tuple prior to the deletion. This creates a conflict. The existing stories of matching dirty tuples are handled differently. Since its's not stored directly whether the story is a product of an insertion or a replacement, any matching visible tuple is marked as read by the counting transaction and any matching invisible one is marked as gap read, so the conflicting scenarios remain the same for old stories. One thing to be noted is that using the cardinality config introduces a performance regression against the current version of memtx, this is to be mitigated in the scope of #10322. Part of #8204 Closes #10140 NO_DOC=perf improvement NO_CHANGELOG=TBD when fully implemented


79fe74c2ff Serge Petrenko

memtx: refactor the in-index tuple stories iteration out

The `memtx_tx_index_invisible_count_slow` iterates over stoies of tuples existing in the index in order to count invisible ones. A similar functionality will be required when count gaps will be implemented, so let's refactor this part out of the function and make it macro. Needed for #8204 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring


8942428437 Serge Petrenko

memtx: split the `memtx_tx_tuple_clarify_impl` function

Prior to this patch the `memtx_tx_tuple_clarify_impl` function been used in order to clarify a tuple from index. Similar functionality regarding to top tuple stories will be required when count gaps will be implemented, so let's split the function into two: `memtx_tx_tuple_clarify_impl` and `memtx_tx_story_clarify_impl`, and make the first one call the latter. Needed for #8204 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring


7bcbdc9745 Serge Petrenko

memtx: refactor the tree index lookup out

Prior to this patch, the tree lookup had been performed in the `memtx_tree_index_iterator_start` function, but it will also be required when the accelerated index count will be implemented in the memtx tree, so it needs to be refactored out for the sake of reusability. This patch refactors the key lookup logic into a new function: `memtx_tree_lookup`, and makes the `memtx_tree_index_iterator_start` use it. Needed for #8204 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring


8705fef8d7 Serge Petrenko

memtx: refactor the tree index lookup canonicalization out

During the iterator creation the memtx tree canonicalizes the given key and iterator type in order to verify the input and restrict the iterator type values. This includes the iterator type and key parts check, type transforming and key canonicalization. These steps are required for the fast index count to be implemented in the memtx tree and for fixing the #10140, so it's refactored out for the sake of reusability. This patch introduces the `memtx_tree_lookup_canonicalize` function which performs these transformations and validations and uses it in the `memtx_tree_index_create_iterator`. Needed for #8204 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring


26afbd4cad Yaroslav Lobankov

test: use `server` module with config support from luatest

NO_DOC=test NO_TEST=test NO_CHANGELOG=test


9ed5084d58 Yaroslav Lobankov

test: use `cbuilder` module from luatest

Also, adapt tests in accordance with the module interface. NO_DOC=test NO_TEST=test NO_CHANGELOG=test


90d197ded1 Yaroslav Lobankov

test: use `justrun` module from luatest

NO_DOC=test NO_TEST=test NO_CHANGELOG=test


Branches



























































































Tags

Tree

.editorconfigcommits | blame
.gdbinitcommits | blame
.gitattributescommits | blame
.github/
.gitignorecommits | blame
.gitmodulescommits | blame
.luacheckrccommits | blame
.pack.mkcommits | blame
.test.mkcommits | blame
AUTHORScommits | blame
CMakeLists.txtcommits | blame
CONTRIBUTING.mdcommits | blame
Doxyfilecommits | blame
Doxyfile.API.incommits | blame
FreeBSD/
LICENSEcommits | blame
README.FreeBSDcommits | blame
README.MacOSXcommits | blame
README.OpenBSDcommits | blame
README.mdcommits | blame
TODOcommits | blame
apk/
asan/
changelogs/
cmake/
debian/
doc/
docker/
extra/
patches/
perf/
rpm/
rump/
src/
static-build/
test/
test-run$commits | blame
third_party/
tools/

README.md

# Tarantool

[![Actions Status][actions-badge]][actions-url]
[![Code Coverage][coverage-badge]][coverage-url]
[![OSS Fuzz][oss-fuzz-badge]][oss-fuzz-url]
[![Telegram][telegram-badge]][telegram-url]
[![GitHub Discussions][discussions-badge]][discussions-url]
[![Stack Overflow][stackoverflow-badge]][stackoverflow-url]

[Tarantool][tarantool-url] is an in-memory computing platform consisting of a
database and an application server.

It is distributed under [BSD 2-Clause][license] terms.

Key features of the application server:

* Heavily optimized Lua interpreter with incredibly fast tracing JIT compiler,
  based on LuaJIT 2.1.
* Cooperative multitasking, non-blocking IO.
* [Persistent queues][queue].
* [Sharding][vshard].
* [Cluster and application management framework][cartridge].
* Access to external databases such as [MySQL][mysql] and [PostgreSQL][pg].
* A rich set of built-in and standalone [modules][modules].

Key features of the database:

* MessagePack data format and MessagePack based client-server protocol.
* Two data engines: 100% in-memory with complete WAL-based persistence and an
  own implementation of LSM-tree, to use with large data sets.
* Multiple index types: HASH, TREE, RTREE, BITSET.
* Document oriented JSON path indexes.
* Asynchronous master-master replication.
* Synchronous quorum-based replication.
* RAFT-based automatic leader election for the single-leader configuration.
* Authentication and access control.
* ANSI SQL, including views, joins, referential and check constraints.
* [Connectors][connectors] for many programming languages.
* The database is a C extension of the application server and can be turned
  off.

Supported platforms are Linux (x86_64, aarch64), Mac OS X (x86_64, M1), FreeBSD
(x86_64).

Tarantool is ideal for data-enriched components of scalable Web architecture:
queue servers, caches, stateful Web applications.

To download and install Tarantool as a binary package for your OS or using
Docker, please see the [download instructions][download].

To build Tarantool from source, see detailed [instructions][building] in the
Tarantool documentation.

To find modules, connectors and tools for Tarantool, check out our [Awesome
Tarantool][awesome-list] list.

Please report bugs to our [issue tracker][issue-tracker]. We also warmly
welcome your feedback on the [discussions][discussions-url] page and questions
on [Stack Overflow][stackoverflow-url].

We accept contributions via pull requests. Check out our [contributing
guide][contributing].

Thank you for your interest in Tarantool!

[actions-badge]: https://github.com/tarantool/tarantool/workflows/release/badge.svg
[actions-url]: https://github.com/tarantool/tarantool/actions
[coverage-badge]: https://coveralls.io/repos/github/tarantool/tarantool/badge.svg?branch=master
[coverage-url]: https://coveralls.io/github/tarantool/tarantool?branch=master
[telegram-badge]: https://img.shields.io/badge/Telegram-join%20chat-blue.svg
[telegram-url]: http://telegram.me/tarantool
[discussions-badge]: https://img.shields.io/github/discussions/tarantool/tarantool
[discussions-url]: https://github.com/tarantool/tarantool/discussions
[stackoverflow-badge]: https://img.shields.io/badge/stackoverflow-tarantool-orange.svg
[stackoverflow-url]: https://stackoverflow.com/questions/tagged/tarantool
[oss-fuzz-badge]: https://oss-fuzz-build-logs.storage.googleapis.com/badges/tarantool.svg
[oss-fuzz-url]: https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_tarantool/latest
[tarantool-url]: https://www.tarantool.io/en/
[license]: LICENSE
[modules]: https://www.tarantool.io/en/download/rocks
[queue]: https://github.com/tarantool/queue
[vshard]: https://github.com/tarantool/vshard
[cartridge]: https://github.com/tarantool/cartridge
[mysql]: https://github.com/tarantool/mysql
[pg]: https://github.com/tarantool/pg
[connectors]: https://www.tarantool.io/en/download/connectors
[download]: https://www.tarantool.io/en/download/
[building]: https://www.tarantool.io/en/doc/latest/dev_guide/building_from_source/
[issue-tracker]: https://github.com/tarantool/tarantool/issues
[contributing]: CONTRIBUTING.md
[awesome-list]: https://github.com/tarantool/awesome-tarantool/