roles: list differences between cartridge roles and tarantool 3 roles
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Related dev. issue(s): https://github.com/tarantool/tarantool/issues/9078
Related doc. issue(s): https://github.com/tarantool/doc/issues/3702
Product: Tarantool
Since: 3.0.0
Audience/target: application and module developers
Root document: A migration guide inside the Developing applications with Tarantool section
SME: @ Totktonada
Details
There are a couple of differences between cartridge's roles and tarantool 3 roles. I propose to list them in the documentation to ease UX for developers who migrate its application from cartridge to tarantool 3.
The list of known differences:
- No
role_nameparameter. A name of tarantool 3 role is the name of the module (foo/bar/baz.luais afoo.bar.bazrole). - No
initfunction. An initialization code is what the module itself executes onrequire, IOW, the code outside functions on the top level. - The role code is loaded after first
box.cfg(), not before. - Different function names:
validate_config->validate,apply_config->apply. validateandapplyreceivecfgargument that represents a configuration of the given role (roles_cfg.<role name>), not a full config. A full config can be acquired usingconfig:get().- No second
old_cfgargument. <role>.applyis not invoked on RO/RW changes. Useon_event(tarantool/doc#4666) to react on the RO/RW mode changes.stop()is called in the reverse order (according to dependencies). So, higher level roles are stopped first.validate,apply,stopshould raise a Lua error to report an unrecoverable error. Any return value (includingreturn nil, err) is considered as success.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the migration guide inside the Developing applications with Tarantool section and read the related development issue #9078 and documentation issue #3702 for context. Use the listed cartridge-versus-Tarantool 3 differences as the checklist, confirm details with the named SME, and finish when the migration guide clearly documents each difference for application and module developers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100