Skip to content

Commit e0d3956

Browse files
committed
fix
1 parent 959c0a6 commit e0d3956

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/meta/api/src/api_impl/table_api.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ where
389389

390390
SeqV::new(id.seq, *id.data)
391391
} else {
392-
// Reuse the metadata loaded for the engine check when marking the
393-
// existing table as dropped.
394392
let existing = VersionedTable {
395393
id: TableId::new(*id.data),
396394
meta: existing_table_meta,
@@ -1190,7 +1188,7 @@ where
11901188
// get tb_meta of the last table id
11911189
let tbid = TableId { table_id };
11921190
let (tb_meta_seq, tb_meta) = self.get_pb_seq_and_value(&tbid).await?;
1193-
let mut replacement_meta = tb_meta.ok_or_else(|| {
1191+
let mut tb_meta = tb_meta.ok_or_else(|| {
11941192
KVAppError::AppError(AppError::UnknownTableId(UnknownTableId::new(
11951193
table_id,
11961194
"commit_table_meta",
@@ -1204,6 +1202,7 @@ where
12041202
);
12051203

12061204
{
1205+
// reset drop on time
12071206
let mut txn_req = TxnRequest::default();
12081207

12091208
if let Some(prev_table_id) = req.prev_table_id {
@@ -1218,7 +1217,7 @@ where
12181217
TableEngineMismatch::ensure(
12191218
req.name_ident.table_name.as_str(),
12201219
&previous.engine,
1221-
&replacement_meta.engine,
1220+
&tb_meta.engine,
12221221
)
12231222
.map_err(|e| KVAppError::AppError(e.into()))?;
12241223

@@ -1228,12 +1227,12 @@ where
12281227
}
12291228

12301229
// undrop a table with no drop_on time
1231-
if replacement_meta.drop_on.is_none() {
1230+
if tb_meta.drop_on.is_none() {
12321231
return Err(KVAppError::AppError(AppError::UndropTableWithNoDropTime(
12331232
UndropTableWithNoDropTime::new(&tenant_dbname_tbname.table_name),
12341233
)));
12351234
}
1236-
replacement_meta.drop_on = None;
1235+
tb_meta.drop_on = None;
12371236

12381237
txn_req.condition.extend([
12391238
// db has not to change, i.e., no new table is created.
@@ -1252,7 +1251,7 @@ where
12521251
txn_put_pb(&DatabaseId { db_id }, &db_meta), // (db_id) -> db_meta
12531252
txn_put_pb(&dbid_tbname, &TableId::new(table_id)), /* (tenant, db_id, tb_name) -> tb_id */
12541253
// txn_put_pb(&dbid_tbname_idlist, &tb_id_list), // _fd_table_id_list/db_id/table_name -> tb_id_list
1255-
txn_put_pb(&tbid, &replacement_meta), // (tenant, db_id, tb_id) -> tb_meta
1254+
txn_put_pb(&tbid, &tb_meta), // (tenant, db_id, tb_id) -> tb_meta
12561255
txn_del(&orphan_dbid_tbname_idlist), // del orphan table idlist
12571256
txn_put_pb(&dbid_tbname_idlist, &tb_id_list.data), /* _fd_table_id_list/db_id/table_name -> tb_id_list */
12581257
]);

0 commit comments

Comments
 (0)