Skip to content

Conversation

@gengjun-git
Copy link
Contributor

@gengjun-git gengjun-git commented Dec 26, 2025

Why I'm doing:

What I'm doing:

Refer #63357

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Modernizes metadata persistence across FE by shifting many edit-log writes to WAL with in-log appliers and adding replay handlers to ensure atomic, ordered state changes.

  • Introduces WALApplier and updates EditLog with applier-based variants (e.g., logModifyViewDef, logTableRename, logErasePartition, logDeleteReplica, logBackendTabletsInfo, etc.), removing legacy counterparts
  • Refactors operations to apply mutations inside WAL callbacks and adds replay flows: view alter/replay, repo add/remove, recycle bin erase/disable/recover, partition erase/recover, replica delete/bad-mark, DB/table/partition/rollup/column rename, truncate table, set replica status, recover partition version, save transaction id
  • Adjusts handlers/executors to use WAL patterns: AlterJobExecutor/Mgr, AlterMVJobExecutor, SchemaChangeHandler, BackupHandler/RepositoryMgr, CatalogRecycleBin, HiveTable, OlapTable name checks, ReportHandler, TabletScheduler, DeleteJob, LocalMetastore, MaterializedViewMgr, TransactionIdGenerator
  • Minor API/behavior tweaks: split checkNameConflict vs checkAndSetName, alter-view now validates via checkInlineViewDef, drop-partitions consolidated to batch WAL, range-partition recover split into checkRecoverable and recover, and tests updated accordingly

Written by Cursor Bugbot for commit 341e388. This will update automatically on new commits. Configure here.

@wanpengfei-git wanpengfei-git requested a review from a team December 26, 2025 02:59
@gengjun-git gengjun-git changed the title [Refactor] Transform Table/Db/Partition related edit logs to WAL format [Refactor] Transform Table/Db/Partition related simple edit logs to WAL format Dec 26, 2025
@alvin-celerdata
Copy link
Contributor

@cursor review

@gengjun-git gengjun-git marked this pull request as ready for review December 26, 2025 08:06
@gengjun-git gengjun-git requested review from a team as code owners December 26, 2025 08:06
@gengjun-git
Copy link
Contributor Author

@mergify rebase

Signed-off-by: gengjun-git <[email protected]>
Signed-off-by: gengjun-git <[email protected]>
Signed-off-by: gengjun-git <[email protected]>
Signed-off-by: gengjun-git <[email protected]>
Signed-off-by: gengjun-git <[email protected]>
Signed-off-by: gengjun-git <[email protected]>
@mergify
Copy link
Contributor

mergify bot commented Dec 26, 2025

rebase

✅ Branch has been successfully rebased

@gengjun-git gengjun-git force-pushed the refactor_db_table_simple_logs branch from 57b789a to 341e388 Compare December 26, 2025 09:37
@sonarqubecloud
Copy link

@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

fail : 137 / 222 (61.71%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/alter/AlterHandler.java 0 2 00.00% [134, 135]
🔵 com/starrocks/scheduler/mv/MaterializedViewMgr.java 0 5 00.00% [172, 173, 175, 178, 179]
🔵 com/starrocks/catalog/View.java 0 1 00.00% [161]
🔵 com/starrocks/catalog/CatalogRecycleBin.java 7 31 22.58% [525, 527, 529, 530, 532, 536, 540, 561, 566, 567, 696, 698, 699, 700, 833, 886, 887, 892, 893, 894, 895, 896, 897, 898]
🔵 com/starrocks/persist/EditLog.java 10 22 45.45% [560, 1451, 1472, 1480, 1532, 1556, 1560, 1727, 1771, 1899, 1903, 2031]
🔵 com/starrocks/server/LocalMetastore.java 36 60 60.00% [724, 725, 741, 806, 1447, 1449, 1465, 1467, 1504, 2832, 2833, 2834, 3492, 3494, 3495, 3572, 3680, 3681, 3682, 3970, 3972, 4454, 4455, 4664]
🔵 com/starrocks/alter/AlterJobMgr.java 17 27 62.96% [597, 598, 599, 600, 601, 602, 604, 605, 606, 607]
🔵 com/starrocks/clone/TabletScheduler.java 4 5 80.00% [1434]
🔵 com/starrocks/leader/ReportHandler.java 16 19 84.21% [1083, 1253, 1276]
🔵 com/starrocks/backup/RepositoryMgr.java 21 24 87.50% [89, 104, 132]
🔵 com/starrocks/catalog/HiveTable.java 13 13 100.00% []
🔵 com/starrocks/catalog/OlapTable.java 6 6 100.00% []
🔵 com/starrocks/transaction/TransactionIdGenerator.java 5 5 100.00% []
🔵 com/starrocks/alter/SchemaChangeHandler.java 2 2 100.00% []

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@alvin-celerdata
Copy link
Contributor

@cursor review


GlobalStateMgr.getCurrentState().getEditLog()
.logRecoverPartitionVersion(new PartitionVersionRecoveryInfo(partitionsToRecover, System.currentTimeMillis()));
.logRecoverPartitionVersion(recoveryInfo, wal -> recoverPartitionVersion(recoveryInfo));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partition version recovery executed twice in MetaRecoveryDaemon

The recoverPartitionVersion(recoveryInfo) method is called twice during WAL refactoring: once directly at line 181, and again in the WAL callback at line 184. This appears to be an incomplete refactoring where the direct call at line 181 was not removed when the WAL callback pattern was introduced. The correct WAL pattern requires removing the direct call and only executing the operation within the callback. This causes partition versions to be recovered twice, which could lead to redundant operations and potentially unexpected behavior.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants