mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-11-10 05:42:02 +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::{
|
write::{
|
||||||
key::DeserializeBigEndian, AssignedIds, Batch, BitmapClass, Operation, RandomAvailableId,
|
key::DeserializeBigEndian, AssignedIds, Batch, BitmapClass, Operation, RandomAvailableId,
|
||||||
ValueOp, MAX_COMMIT_ATTEMPTS, MAX_COMMIT_TIME,
|
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};
|
use super::{into_error, MysqlStore};
|
||||||
|
|
@ -264,11 +266,11 @@ impl MysqlStore {
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Err(err) = trx.exec_drop(&s, (key,)).await {
|
if let Err(err) = trx.exec_drop(&s, (key,)).await {
|
||||||
|
trx.rollback().await?;
|
||||||
return Err(
|
return Err(
|
||||||
if is_document_id
|
if is_document_id
|
||||||
&& matches!(&err, Error::Server(err) if [1062, 1213].contains(&err.code))
|
&& matches!(&err, Error::Server(err) if [1062, 1213].contains(&err.code))
|
||||||
{
|
{
|
||||||
trx.rollback().await?;
|
|
||||||
CommitError::Retry
|
CommitError::Retry
|
||||||
} else {
|
} else {
|
||||||
CommitError::Mysql(err)
|
CommitError::Mysql(err)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue