Skip to content

Fix/reentarable pico schema change api

Georgy Moshkin requested to merge fix/reentarable-pico-schema-change-api into master

Part of #313 (closed)

  • Change some of the error message a little bit, so that they are easier to match in string representation (temporary change which should become unnecessary after #307)
  • Refactor stuff related to cas and _pico_property reducing the copy paste a bit
  • Add a reenterable_schema_change_request lua function which implements the algorithm described in the Storage Schema Rfc
  • Use this reenterable_schema_change_request function in all of the pico.* acl related functions

TODO:

  • Tests which check that retriable errors are handled correctly
  • Make pico.create_space, pico.drop_space re-enterable

Making ddl requests re-enterable will be trickier and will require modifications to the algorithm from the RFC to handle some cases. For example it will not currently handle this situation:

  1. User calls pico.create_space({ timeout = 3 })
  2. DdlPrepare is committed
  3. 3 seconds pass, pico.create_space times out.
  4. User calls pico.create_space() again
  5. pico.create_space() waits for no pending schema change
  6. DdlAbort is committed (there was a conflict on a lagging instance)
  7. pico.create_space() checks if space exists -> it doesn't
  8. pico.create_space() proposes another cas request
  9. goto 2.

The smaller the timeout value is the more likely this loop will last for long.

Edited by Georgy Moshkin

Merge request reports