-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](cloud) Skip empty partition meta RPCs in cloud restore #67139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6e1ce8d
87d783e
14bd4c8
15b5f44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,10 +241,13 @@ public void doCreateReplicas() { | |
| } | ||
| // set storage vault for new restoring table | ||
| if (((CloudEnv) Env.getCurrentEnv()).getEnableStorageVault()) { | ||
| if (Strings.isNullOrEmpty(storageVaultId)) { | ||
| storageVaultId = Env.getCurrentEnv().getStorageVaultMgr().getVaultIdByName(storageVaultName); | ||
| } | ||
| for (Table table : restoredTbls) { | ||
| if (table.getType() == TableIf.TableType.OLAP) { | ||
| OlapTable olapTable = (OlapTable) table; | ||
| if (olapTable.getStorageVaultId().isEmpty() && storageVaultId != null) { | ||
| if (olapTable.getStorageVaultId().isEmpty()) { | ||
| olapTable.setStorageVaultId(storageVaultId); | ||
| } | ||
| } | ||
|
|
@@ -494,6 +497,11 @@ private void handleMetaObject(MetaSeriviceOperation operation) throws DdlExcepti | |
|
|
||
| private void handleOlapTableMeta(MetaSeriviceOperation operation, OlapTable olapTable, | ||
| Collection<Partition> partitions) throws DdlException { | ||
| if (partitions.isEmpty()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Preserve the index lifecycle for an empty restored table This avoids the invalid empty-partition RPCs, but it also skips the index-only lifecycle used by normal empty Cloud table creation. That path still calls prepare/commit materialized-index; commit-index creates the versioned index mappings and initializes the table version. A later ADD PARTITION only commits partition keys, so it does not repair the missing index mappings. The orphan recycler then sees no index-inverted key for the table and can delete the newly added partition and table-version metadata. Please use a replay-safe index PREPARE/COMMIT lifecycle for zero partitions, including cleanup of prepared/committed transient IDs on cancellation or PENDING replay, instead of suppressing all Meta Service work. |
||
| LOG.info("cloud restore job skip {} partitions, dbId: {}, tableName: {}, vault name: {}", | ||
| operation, dbId, olapTable.getName(), storageVaultName); | ||
| return; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Do not register an unpartitioned table without its implicit partition The new test exercises a |
||
| } | ||
| List<Long> partitionIds = new ArrayList<>(); | ||
| switch (operation) { | ||
| case PREPARE: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Do not treat the asynchronous vault cache as authoritative
For an empty restore there is no create-tablets response to validate the vault, so this lookup is the only source of the ID. After restart/master promotion,
storageVaultIdis transient and the vault map starts empty;BackupHandlercan resume jobs beforeCloudInstanceStatusCheckerpopulates it, turning a valid restore into a permanent cancellation. The map can also be stale: the checker leaves old entries when Meta Service reports zero vaults, so deleting the last vault can let this code persist a deleted nonempty ID. Please resolve/revalidate the vault from an authoritative source at empty-table creation time, treating transient unavailability as retry/defer and definitive absence as failure before registration; merely serializing the earlier cached ID would not handle deletion.