All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Add
_recovery_pointsystem space introduced in upcoming Tarantool 3.8 to crud.schema system spaces. - Add
crud.locate()method to find whether a tuple is inmemtxorvinylengine. Works for spaces managed by the enterprisecoolermodule. - Support for
mode,balance,prefer_replicaandrequest_timeoutoptions incrud.len.
- Allow read-only operations (
get,select,pairs,count,min,max) to execute successfully using healthy replicas when all cluster masters are down. - Add
tnt_crud_storage_nil_bucket_id_compat_totalmetric to track operations performed without bucket_ref (legacy router compatibility mode). - Fixed storage compatibility with routers < 1.7.0 by handling nil bucket_id in get, update, and delete operations. Now storage skips bucket referencing and logs a rate-limited warning about reduced rebalance safety during rolling upgrades.
- Optimize
crud.select()andcrud.pairs()pagination withaftercursor by using nativeafteroption on Tarantool 2.10+ for O(1) cursor positioning. Readview operations use nativeafteronly on Tarantool 3.x (#488).
- Add
tnt_crud_router_cache_clear_tsmetric to router to help user correctly disable safe mode in cluster.
- Return bucket_ref error as array in
crud.*_manymethods. - Move bucket_unref out of transaction.
- Prevent duplicate metrics if init function is called multiple times.
- Prevent creating duplicate triggers on
_crud_settings_localspace if init function is called multiple times. - Fix deadlock in
crud.schema()after schema reload error (#479).
- Remove
tnt_crud_storage_safe_mode_enabledmetric from router.
- Stop marking/killing fast-mode iproto fibers on safe-mode switch.
Storage ops are asserted by
yield_checksin tests. - Move switch to safe mode from
on_committrigger toon_replacetrigger. - vinyl spaces always work in safe mode.
- Implement "safe" mode to prevent writing data to wrong replicaset when vshard rebalance is in progress (#448).
- Auto switch to safe mode when rebalance process starts.
- Manual return to fast mode.
- drop wrap_box_space_func_result to cut allocations and speed up storage calls.
- Support for
vshard'srequest_timeoutparameter for calls withmode = 'read'
- Auto-fill
bucket_idfor primary-key CRUD requests (get/update/delete) when the sharding index is the primary index andbucket_idis passed asbox.NULL.
- bumped: vshard version in rockspec.
- Role model support in CRUD is provided (commit).
- Validation of
bucket_id. Invalid values now raiseBucketIDErrorbefore routing (commit).
- Fixed compatibility with cartridge
2.16.0. crud.schemano longer returns TCF system space_cdc_state.crud.schemano longer returns system space_gc_consumerswith Tarantool 3.2+.crud.schemano longer returnsttsystem space_tt_migrations.- Tests of
schemawith Tarantool 3.2+. - Fixed bad error handling for method
call.single - Added support for working in 3.1 with data from 2.11, previously there was an error due to the inability to find the replicasets by name (commit).
insert_many,insert_object_many,replace_many,replace_object_many,upsert_many,upsert_object_manyoperations no longer fail withShardingHashMismatchErrorif a space has custom sharding info and every tuple/object in the request hasbucket_idset (#437).
- Clarify license in the rockspec (#434).
- Asynchronous bootstrap support for storages (#412).
- Tarantool 3 roles for setting up crud routers and storages (#415).
- Ability to configure crud through Tarantool 3 roles configuration (#415).
- Explicitly forbid datetime interval conditions (#373).
- Storage initialization is now asynchronous by default for Tarantool 3.0+ (#412).
- Additionally check backoff error on storage info fetch (#427).
- Working with datetime conditions in case of non-indexed fields or non-iterating indexes (#373).
- Precision loss for decimal conditions in case of non-indexed fields or non-iterating indexes (#373).
- Passing errors from storages for merger operations (
crud.select,crud.pairs,readview:select,readview:pairs) (#423). - Working with
niloperand conditions in case of non-indexed fields or non-iterating indexes (#422).
- Compatibility with vshard configuration if UUIDs are omitted (#407).
- Compatibility with automatic master discovery in vshard (#409).
- Secondary conditions for index operands with operations
>=,<=,>,<no longer cause missing part of the actual result for scan operations (crud.select,crud.pairs,crud.count,readview:select,readview:pairs) (#418).
modeoption forcrud.minandcrud.max(#404).
- Compatibility with vshard 0.1.25
name_as_keyidentification mode for Tarantool 3.0 (#403). - Propagating
noreturnandfetch_latest_metadataoptions in case of intermediate nullable fields update for Tarantool 2.7 and older (#404).
- Dropped external tuple merger and tuple keydef modules installation from the package build (#390).
- Compatibility with Tarantool 3.0 binary protocol change (#390).
- Compatibility with Tarantool 3.0 tuple objects (#390).
- Space schema introspection API
crud.schema(#380).
deps.shinstalls thevshardinstead of thecartridgeby default (#364). You could to specify an environment variableCARTIRDGE_VERSIONto install thecartridgeand run tests cases with it.- Return explicit error for
*_manycall with no tuples/objects (#377). - Quickstart section in the README.md focuses on usage with
vshardinstead ofCartridge(#366).
crud.readviewresource cleanup on garbage collect (#379).doc/playground.luadoes not work with Tarantool 3 (#371).- Tests with Tarantool 3 (#364).
- VShard storage user have not execution rights for internal functions (#366).
- Compatibility with Tarantool 3.0 tuple objects (#387).
- Read view support for select and pairs (#343).
- Add
noreturnoption for operations:insert,insert_object,insert_many,insert_object_many,replace,replace_object,replace_many,insert_object_many,upsert,upsert_object,upsert_many,upsert_object_many,update,delete(#267).
- Crud DML operations returning stale schema for metadata generation.
Now you may use
fetch_latest_metadataflag to work with latest schema (#236).
- Yield on select/pairs storage tuple lookup (#312).
- Naming of
DEVenvironment variable toTARANTOOL_CRUD_ENABLE_INTERNAL_CHECKS(#250).
- Loaded functions misleading coverage (#249).
- Add versioning support (PR #342).
- Pre-hotreload
cartridgesupport (older than 2.4.0) (PR #341). - Tarantool version-dependent features for 3.x (PR #344).
- Add timeout condition for the validation of master presence in replicaset and for the master connection (#95).
- Support Cartridge clusterwide configuration for
crud.cfg(#332).
- Breaking: forbid using space id in
crud.len(#255).
- Add validation of the master presence in replicaset and the
master connection to the
utils.get_spacemethod before receiving the space from the connection (#331). - Fix fiber cancel on schema reload timeout in
call_reload_schema(PR #336).
skip_nullability_check_on_flattenoption forinsert_object,insert_object_many,replace_object,replace_object_many.falseby default. By setting the option totrueyou allow setting null values to non-nullable fields, which can be useful if non-nullable field value is generated by sequence. Warning: there is no native support for sequences in sharded systems since each replicaset has its own sequence. If sequence field is a part of the sharding key (which is true by default), choosing the bucket id is the sole responsibility of the developer (#328).
- Rework
NonInitializederror message to be more helpful for troubleshooting (#326).
- Support
vshard_routeroption in operations for Cartridge vshard groups or non-default vshard routers (#44).
- Deprecate using space id in
crud.len(#255).
crud.storage_infofunction to get storages status (#229).
- Fix specifying
vshardsharding funcs (#314).
- Fetching invalid ddl configuration (sharding key for non-existing space) is no longer breaks CRUD requests (#308).
- ddl space record delete no more throws error if crud is used (#310).
- crud sharding metainfo is now updated on ddl record delete (#310).
- Batch insert/upsert operation
crud.insert_many()/crud.insert_object_many()/crud.upsert_many()/crud.upsert_object_many()crud.replace_many()/crud.replace_object_many()with partial consistency (#193).
- Optimize
crud.select()without conditions and withafter. - Behaviour of potentially long
selectandcountcalls: a critical log entry containing the current stack traceback is created upon such function calls — an user can explicitly request a full scan through by passingfullscan=truetoselectorcountoptions table argument in which case a log entry will not be created (#276). - Make select error description more informative when merger built-in module or tuple-merger external module is used in case of disabled/uninit storage (#229).
-
crud.select()if a condition is '<=' and it's value <after.Before this patch:
-
- [2, 401, 'Sergey', 'Allred', 21]
- [1, 477, 'Alexey', 'Adams', 20] ...
After this patch:
-
- [3, 2804, 'Pavel', 'Adams', 27]
- [2, 401, 'Sergey', 'Allred', 21]
- [1, 477, 'Alexey', 'Adams', 20] ...
-
-
crud.select()filtration by a first condition if the condition is '>' or '>=' and it's value >after.Before this patch:
-
- [3, 2804, 'Pavel', 'Adams', 27]
- [4, 1161, 'Mikhail', 'Liston', 51]
- [5, 1172, 'Dmitry', 'Jacobi', 16]
- [6, 1064, 'Alexey', 'Sidorov', 31] ...
After this patch:
- [5, 1172, 'Dmitry', 'Jacobi', 16]
- [6, 1064, 'Alexey', 'Sidorov', 31] ...
-
-
crud.select()results order with negativefirst. -
crud.select()if a condition is '=' or '==' with negativefirst.Suppose we have a non-unique secondary index by the field
agefield and a space:- metadata: [{'name': 'id', 'type': 'unsigned'}, {'name': 'bucket_id', 'type': 'unsigned'},
{'name': 'name', 'type': 'string'}, {'name': 'surname', 'type': 'string'}, {'name': 'age',
'type': 'number'}]
rows:
- [1, 477, 'Alexey', 'Adams', 20]
- [2, 401, 'Sergey', 'Allred', 27]
- [3, 2804, 'Pavel', 'Adams', 27]
- [4, 1161, 'Mikhail', 'Liston', 27]
- [5, 1172, 'Dmitry', 'Jacobi', 27]
- [6, 1064, 'Alexey', 'Sidorov', 31]
- null ...
Before this patch:
- [] ...
After this patch:
-
- [2, 401, 'Sergey', 'Allred', 27]
- [3, 2804, 'Pavel', 'Adams', 27] ...
- metadata: [{'name': 'id', 'type': 'unsigned'}, {'name': 'bucket_id', 'type': 'unsigned'},
{'name': 'name', 'type': 'string'}, {'name': 'surname', 'type': 'string'}, {'name': 'age',
'type': 'number'}]
rows:
- Make metrics quantile collector age params configurable (#286).
- Add separate
latency_averageandlatency_quantile_recentfields tocrud.stats()output (#286).
- Preset
stats_quantile_tolerated_errorcrud.cfgparameter is no more lost on configuration update (#284).
- Make metrics quantile collector tolerated error configurable (#281).
- Change metrics quantile collector default tolerated error from 1e-2 to 1e-3 (#281).
- Requests no more fail with "Sharding hash mismatch" error if ddl set and bucket_id is explicitly specified (#278).
Caution: Use CRUD 0.11.1 instead of 0.11.0. It fixes critical bug for some requests (see #278).
crud.count()function to calculate the number of tuples in the space according to conditions.- Support bucket id calculating using sharding func specified in
DDL schema or in
_ddl_sharding_funcspace. - Statistics for CRUD operations on router (#224).
- Integrate CRUD statistics with
metrics(#224). - Added LICENSE file into the repository (BSD-2-Clause).
- Optimize select with known bucket_id (#234).
- Deprecate manual sharding schema reload (#212).
- Fix processing storage error for tuple-merger implementation of select/pairs (#271).
- Do not change input tuple object in requests.
- Add automatic reload of DDL schema (#212).
- CRUD operations calculates bucket id automatically using sharding
key specified with DDL schema or in
_ddl_sharding_keyspace. NOTE: CRUD methods delete(), get() and update() requires that sharding key must be a part of primary key.
- Use tuple-merger backed select implementation on tarantool 2.10+ (it gives less pressure on Lua GC).
- DDL sharding key now can be extracted from select conditions even if there are no separate index.
crud.len()function to calculate the number of tuples in the space for memtx engine and calculate the maximum approximate number of tuples in the space for vinyl engine.- Testing: added integration with service coveralls.io (PR #195).
- Testing: added integration with luacov that allows to generate report with code coverage statistics (PR #195).
- Names of errors generated by CRUD operations have been unified (PR #184).
- Opmimize
crud.select()/crud.pairs()for one replicaset case (say, whenbucket_idis passed or deducible from conditions). It gives 13% boost on the case from #220 (PR #226).
- Ignoring of an error in
crud.pairs()(#144). - Damaging of opts table by CRUD methods (#192).
- Ignoring of
bucket_idoption incrud.select()/crud.pairs()(#220).
- Invalid results for pagination queries when filtering on a part of a composite index
- Added jsonpath indexes support for queries
tuple-mergermodule updated to 0.0.2
- Compatibility with Tarantool versions that don't support key_def and merger modules.
- Ignoring
opts.firstoncrud.pairscall - External
keydefcompatibility with built-inmerger
- Fixed error for partial result option if field contains box.NULL.
- Fixed incorrect
crudresults during reverse pagination without specifyingbatch_size. - Fixed crud roles reload:
- before this patch reload wasn't fair - reloading
tuple.mergerandtuple.keydefmodules failed, and crud started to usecrud.select.compat.select_oldmodule with naive merger implementation; - fair reloading
tuple.mergerandtuple.keydefled to the error that was fixed by caching loaded module in the special global variable not cleaned on reloading roles; - ability of using
tuple.mergerandtuple.keydefmodules now is checked by callingpackage.search, built-inmergerandkeydefmodules are used if present inpackage.loaded. It allows to avoid ignoring errors on checking modules existing viapcall(require, '<module_name>').
- before this patch reload wasn't fair - reloading
- Fixed some cases when module ignored schema updates.
- Preserve "Bootstrap vshard" button in WebUI operable even if vshard roles are hidden explicitly.
cut_rowsandcut_objectsfunctions to cut off scan key and primary key values that were merged to the select/pairs partial result.- Functions
stop()for the rolescrud-storageandcrud-router. - Option flag
force_map_callforselect()/pairs()to disable thebucket_idcomputation from primary key. crud.minandcrud.maxfunctions to find the minimum and maximum values in the specified index.- Added support for jsonpath for select.
-
Fixed not finding field in tuple on
crud.updateif there areis_nullablefields in front of it that were added when the schema was changed for Tarantool version <= 2.2. -
Pagination over multipart primary key.
mode,prefer_replicaandbalanceoptions for read operations (get, select, pairs). According to this parameters one of vshard calls (callrw,callro,callbro,callre,callbre) is selected
- Fixed not finding field in tuple on
crud.updateif there areis_nullablefields in front of it that were added when the schema was changed. - Fixed select crash when dropping indexes
- Using outdated schema on router-side
- Sparsed tuples generation that led to "Tuple/Key must be MsgPack array" error
- Support for UUID field types and UUID values
fieldsoption for simple operations and select/pairs calls with pagination support to get partial result
- Fixed typo in error for case when failed to get
bucket_id - Fixed select by part of sharding key equal. Before this patch selecting by equality of partially specified multipart primary index value was misinterpreted as a selecting by fully specified key value.
- Fixed iteration with
pairsthrough empty space returnednil.
truncateoperation- iterator returned by
pairsis compatible with luafun
- Select by primary index name
- Fix error handling select with invalid type value
- Get rid of performing map-reduce for single-replicaset operations
crud-routerCartridge rolebucket_idoption for all operations to specify custom bucket ID. For operations that accepts tuple/object bucket ID can be specified as tuple/object field as well asopts.bucket_idvalue.
- CRUD-router functions are exposed to the global scope, so it's possible to call
crud-operations via
net.box.call crud.initis removed in favor tocrud.init_storageandcrud.init_router
- Select with
==conditions bugs - Select with conditions by fields with collations
- CRUD operations:
- replace
- upsert
- Output format for CRUD operations changed to set of rows and metadata
- Insert/replace/upsert methods now accept tuples. To process unflattened objects *_object methods are introduced.
pairsacceptsuse_tomapflag to return tuples or objects
checksis disabled for internal functions by defaultlimitoption is renamed tofirst- Reverse pagination (negative
first) is supported afteroption accepts a tuple
- Basic CRUD operations:
- insert
- get
- select
- update
- delete
pairsfunction to iterate across the distributed space