mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-12 15:04:22 +08:00
mySQL rollback on bitmap errors
This commit is contained in:
parent
dc2a59e8d9
commit
4c7052d227
1 changed files with 4 additions and 2 deletions
|
@ -16,7 +16,9 @@ use crate::{
|
|||
write::{
|
||||
key::DeserializeBigEndian, AssignedIds, Batch, BitmapClass, Operation, RandomAvailableId,
|
||||
ValueOp, MAX_COMMIT_ATTEMPTS, MAX_COMMIT_TIME,
|
||||
}, BitmapKey, IndexKey, Key, LogKey, SUBSPACE_COUNTER, SUBSPACE_IN_MEMORY_COUNTER, SUBSPACE_QUOTA, U32_LEN
|
||||
},
|
||||
BitmapKey, IndexKey, Key, LogKey, SUBSPACE_COUNTER, SUBSPACE_IN_MEMORY_COUNTER, SUBSPACE_QUOTA,
|
||||
U32_LEN,
|
||||
};
|
||||
|
||||
use super::{into_error, MysqlStore};
|
||||
|
@ -264,11 +266,11 @@ impl MysqlStore {
|
|||
};
|
||||
|
||||
if let Err(err) = trx.exec_drop(&s, (key,)).await {
|
||||
trx.rollback().await?;
|
||||
return Err(
|
||||
if is_document_id
|
||||
&& matches!(&err, Error::Server(err) if [1062, 1213].contains(&err.code))
|
||||
{
|
||||
trx.rollback().await?;
|
||||
CommitError::Retry
|
||||
} else {
|
||||
CommitError::Mysql(err)
|
||||
|
|
Loading…
Add table
Reference in a new issue