Skip to content

Reenterant idempotent API

Currently this scenario is possible

picodata> pico.create_space({ name = 'S', ..., timeout = 3 })
---
- null
- timeout
...

picodata> pico.create_space({ name = 'S', ..., timeout = 3 })
---
- null
- 'ddl failed: space creation failed: space with name S already exists'
...

picodata> box.space._raft_log:select({}, { iterator = 'LT', limit = 1 }) -- get last raft entry
---
- [0, 39, 2, '', [[1, 1, 29], ['ddl_prepare', 1, ['create_space', 1026, 'S', ... ]]]]
...

Meaning ddl_prepare entry was applied localy but ddl wasn't finalized yet for some reason (a replicaset is unavailable), so pico.create_space timed out, but the next pico.create_space reports that the space already exists, even though it may get rolled back later (read uncommitted).

RFC instead suggests the subsequent pico.create_space should also time out and eventually return the index of the applied ddl commit entry instead of a space exists error

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information