apache / incubator-horaedb-meta

Meta service of HoraeDB cluster.
https://horaedb.apache.org
Apache License 2.0
27 stars 15 forks source link

refactor: make create table idempotent #286

Closed ZuLiangWang closed 10 months ago

ZuLiangWang commented 11 months ago

Rationale

Store the intermediate data for table creation through procedures to support idempotent table creation.

Detailed Changes

Test Plan

Pass all unit tests and integration tests.

ShiKaiWi commented 10 months ago

@ZuLiangWang After a bit of reviewing, I find the table id is not persisted in the TableAssign procedure, and table creation may fail if a new table id is allocated in the second retry. And is it true?

ShiKaiWi commented 10 months ago

@ZuLiangWang After a bit of reviewing, I find the table id is not persisted in the TableAssign procedure, and table creation may fail if a new table id is allocated in the second retry. And is it true?

After digging into the code not included by this PR, I find the table id will be fetched from the table meta data, so the second creation will use the same table id as before.