Uh oh!
There was an error while loading. Please reload this page.
[fix](load) Fix potential data loss during disk migration - #42296
Conversation
doris-robot
commented
Oct 22, 2024
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
liaoxin01
commented
Oct 22, 2024
run buildall |
liaoxin01
commented
Oct 22, 2024
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
doris-robot
commented
Oct 22, 2024
TeamCity be ut coverage result: |
liaoxin01
commented
Oct 23, 2024
run buildall |
doris-robot
commented
Oct 23, 2024
TeamCity be ut coverage result: |
liaoxin01
commented
Oct 23, 2024
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
liaoxin01
commented
Oct 23, 2024
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
doris-robot
commented
Oct 23, 2024
TeamCity be ut coverage result: |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
The following operations may trigger this issue. 1. migration start 2. load start using old tablet,but wait migration lock in `RowsetBuilder::prepare_txn`. 3. migration finish, old tablet -> new tablet 4. obtained migration lock and commit successfully using old tablet. 5. publish failed using old tablet, because old tablet has been dropped. It cause the data loss. Therefore, after acquiring the migration lock, check if the tablet has already been shut down. If it has, it indicates that it is an old tablet, and data should not be imported into the old tablet.
The following operations may trigger this issue. 1. migration start 2. load start using old tablet,but wait migration lock in `RowsetBuilder::prepare_txn`. 3. migration finish, old tablet -> new tablet 4. obtained migration lock and commit successfully using old tablet. 5. publish failed using old tablet, because old tablet has been dropped. It cause the data loss. Therefore, after acquiring the migration lock, check if the tablet has already been shut down. If it has, it indicates that it is an old tablet, and data should not be imported into the old tablet.
The following operations may trigger this issue. 1. migration start 2. load start using old tablet,but wait migration lock in `RowsetBuilder::prepare_txn`. 3. migration finish, old tablet -> new tablet 4. obtained migration lock and commit successfully using old tablet. 5. publish failed using old tablet, because old tablet has been dropped. It cause the data loss. Therefore, after acquiring the migration lock, check if the tablet has already been shut down. If it has, it indicates that it is an old tablet, and data should not be imported into the old tablet.
Cause: PR #54124 moved the migration and push locks from RowsetBuilder into Tablet::prepare_txn. During that refactor, the call to TxnManager::prepare_txn changed from the const Tablet& overload to the raw tablet_id/tablet_uid overload. This silently bypassed the TABLET_SHUTDOWN guard introduced by PR #42296. Impact: A load thread holding an old Tablet instance could resume after migration and register the stale tablet UID in the transaction map. Publish would then operate on the reloaded Tablet with a new UID and leave the transaction in an E-909 state. Fix: Call the const Tablet& overload with *this while the migration and push locks are held. This preserves the lock encapsulation from PR #54124 and restores the shutdown-tablet protection from PR #42296. Test: Add a deterministic unit test that marks a Tablet as TABLET_SHUTDOWN, verifies Tablet::prepare_txn fails, and verifies no stale tablet entry is registered. TxnManagerTest.* passes 16/16.
Cause: PR #54124 moved the migration and push locks from RowsetBuilder into Tablet::prepare_txn. During that refactor, the call to TxnManager::prepare_txn changed from the const Tablet& overload to the raw tablet_id/tablet_uid overload. This silently bypassed the TABLET_SHUTDOWN guard introduced by PR #42296. Impact: A load thread holding an old Tablet instance could resume after migration and register the stale tablet UID in the transaction map. Publish would then operate on the reloaded Tablet with a new UID and leave the transaction in an E-909 state. Fix: Call the const Tablet& overload with *this while the migration and push locks are held. This preserves the lock encapsulation from PR #54124 and restores the shutdown-tablet protection from PR #42296. Test: Add a deterministic unit test that marks a Tablet as TABLET_SHUTDOWN, verifies Tablet::prepare_txn fails, and verifies no stale tablet entry is registered. TxnManagerTest.* passes 16/16.
Cause: PR #54124 moved the migration and push locks from RowsetBuilder into Tablet::prepare_txn. During that refactor, the call to TxnManager::prepare_txn changed from the const Tablet& overload to the raw tablet_id/tablet_uid overload. This silently bypassed the TABLET_SHUTDOWN guard introduced by PR #42296. Impact: A load thread holding an old Tablet instance could resume after migration and register the stale tablet UID in the transaction map. Publish would then operate on the reloaded Tablet with a new UID and leave the transaction in an E-909 state. Fix: Call the const Tablet& overload with *this while the migration and push locks are held. This preserves the lock encapsulation from PR #54124 and restores the shutdown-tablet protection from PR #42296. Test: Add a deterministic unit test that marks a Tablet as TABLET_SHUTDOWN, verifies Tablet::prepare_txn fails, and verifies no stale tablet entry is registered. TxnManagerTest.* passes 16/16.
Cause: PR apache#54124 moved the migration and push locks from RowsetBuilder into Tablet::prepare_txn. During that refactor, the call to TxnManager::prepare_txn changed from the const Tablet& overload to the raw tablet_id/tablet_uid overload. This silently bypassed the TABLET_SHUTDOWN guard introduced by PR apache#42296. Impact: A load thread holding an old Tablet instance could resume after migration and register the stale tablet UID in the transaction map. Publish would then operate on the reloaded Tablet with a new UID and leave the transaction in an E-909 state. Fix: Call the const Tablet& overload with *this while the migration and push locks are held. This preserves the lock encapsulation from PR apache#54124 and restores the shutdown-tablet protection from PR apache#42296. Test: Add a deterministic unit test that marks a Tablet as TABLET_SHUTDOWN, verifies Tablet::prepare_txn fails, and verifies no stale tablet entry is registered. TxnManagerTest.* passes 16/16.
Cause: PR #54124 moved the migration and push locks from RowsetBuilder into Tablet::prepare_txn. During that refactor, the call to TxnManager::prepare_txn changed from the const Tablet& overload to the raw tablet_id/tablet_uid overload. This silently bypassed the TABLET_SHUTDOWN guard introduced by PR #42296. Impact: A load thread holding an old Tablet instance could resume after migration and register the stale tablet UID in the transaction map. Publish would then operate on the reloaded Tablet with a new UID and leave the transaction in an E-909 state. Fix: Call the const Tablet& overload with *this while the migration and push locks are held. This preserves the lock encapsulation from PR #54124 and restores the shutdown-tablet protection from PR #42296. Test: Add a deterministic unit test that marks a Tablet as TABLET_SHUTDOWN, verifies Tablet::prepare_txn fails, and verifies no stale tablet entry is registered. TxnManagerTest.* passes 16/16.
The following operations may trigger this issue.
RowsetBuilder::prepare_txn.Therefore, after acquiring the migration lock, check if the tablet has already been shut down. If it has, it indicates that it is an old tablet, and data should not be imported into the old tablet.