tarantool / vshard

The new generation of sharding based on virtual buckets
Other
98 stars 29 forks source link

vshard.storage.bucket_stat() fails when called in trigger on vinyl space. #475

Open aensidhe opened 2 weeks ago

aensidhe commented 2 weeks ago

Setup

Expected

I get the info about bucket

Actual

vshard.storage.bucket_stat() crashes with error: A multi-statement transaction can not use multiple storage engines

Important note: if my space would have memtx engine, everything works perfectly.

How to reproduce

  1. Bootstrap vshard any way you want.
  2. Connect to master of any replicaset.
  3. Setup test space:
    box.schema.create_space('test', { engine = 'vinyl' })
    box.space.test:format{ { 'name': 'id', 'type': 'unsigned' }, { 'name': 'bucket_id', 'type': 'unsigned' } }
    box.space.test:create_index('primary', { parts = { 'id' } })
    box.space.test:create_index('bucket_id', { parts = { 'bucket_id' }, unique = false })
    function f(old, new) print(vshard.storage.bucket_stat((old or new).bucket_id)) end
    box.space.test:on_replace(f)
  4. Run the test: box.space.test:insert{1, 1}
  5. See the error: error: A multi-statement transaction can not use multiple storage engines