tarantool / tarantool/doc

[3pt] Lua object representing space remains broken after :drop() rollback

Open
#2,303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

add details reference server
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Product: Tarantool
Since: 2.8.2 ?
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_index/drop/, https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_txn_management/rollback/
SME: @ Korablev77

Details

Subj (note that there's no mvcc mode; light ddl operations are allowed to be in casual txs):

box.cfg{}
s = box.schema.space.create('test')
_ = s:create_index('primary')

box.begin() s:drop() box.rollback()
s
tarantool> s
---
- engine: memtx
  before_replace: 'function: 0x406245a0'
  field_count: 0
  is_sync: false
  ck_constraint: []
  on_replace: 'function: 0x40624578'
  temporary: false
  index: []
  is_local: false
  enabled: false
  name: test
  id: 513
...

As one can see object s does not feature any indexes so it's not usable. Meanwhile box.space.test is absolutely OK:

tarantool> box.space.test
---
...
  index:
    0: &0
      unique: true
      parts:
...
  name: test
  id: 512
...

In case this behavior is not going to change I guess we should at least document it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the box_index/drop and box_txn_management/rollback reference pages, then reproduce the sequence using box.schema.space.create, space:drop, and box.rollback. Done means the post-rollback state of the Lua space object is clarified and either corrected or documented consistently with box.space.test.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.