File tree 1 file changed +14
-2
lines changed
src/meta/src/manager/catalog
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,9 @@ where
256
256
dummy_table_id : TableId ,
257
257
merge_updates : & [ MergeUpdate ] ,
258
258
) -> MetaResult < ( ) > {
259
- let map = & mut self . core . write ( ) . await . table_fragments ;
259
+ let mut guard = self . core . write ( ) . await ;
260
+ let current_revision = guard. table_revision ;
261
+ let map = & mut guard. table_fragments ;
260
262
261
263
let mut table_fragments = BTreeMapTransaction :: new ( map) ;
262
264
@@ -327,7 +329,17 @@ where
327
329
assert ! ( merge_updates. is_empty( ) ) ;
328
330
329
331
// Commit changes and notify about the changes.
330
- commit_meta ! ( self , table_fragments) ?;
332
+ let mut trx = Transaction :: default ( ) ;
333
+
334
+ // save next revision
335
+ let next_revision = current_revision. next ( ) ;
336
+ next_revision. store ( & mut trx) ;
337
+
338
+ // commit
339
+ commit_meta_with_trx ! ( self , trx, table_fragments) ?;
340
+
341
+ // update revision in memory
342
+ guard. table_revision = next_revision;
331
343
332
344
// FIXME: Do not notify frontend currently, because frontend nodes might refer to old table
333
345
// catalog and need to access the old fragment. Let frontend nodes delete the old fragment
You can’t perform that action at this time.
0 commit comments