Description:sqlite双写补充打点上报场景
Sig: SIG_DataManagement
Feature or Bugfix:
Binary Source:No/Yes
TDD:Pass/Fail/NA
XTS:Pass/Fail/NA
Pretest:Pass/Fail/NA

Signed-off-by: linzhuobin <linzhuobin1@huawei.com>
This commit is contained in:
linzhuobin 2024-11-21 16:01:55 +08:00
parent ea0b93c5b0
commit b790f74e0b
2 changed files with 8 additions and 0 deletions

View File

@ -168,6 +168,7 @@ std::pair<int32_t, std::shared_ptr<SqliteConnection>> SqliteConnection::CreateSl
(!isSlaveExist || isSlaveLockExist || hasFailure || walOverLimit))) {
if (walOverLimit) {
SqliteUtils::SetSlaveInvalid(config_.GetPath());
Reportor::Report(Reportor::Create(config, E_SQLITE_ERROR, "ErrorType: slaveWalOverLimit"));
}
return result;
}
@ -1394,6 +1395,7 @@ int SqliteConnection::SqliteNativeBackup(bool isRestore, SlaveStatus &curStatus)
(void)SqliteConnection::Delete(slaveConfig.GetPath());
}
curStatus = SlaveStatus::BACKUP_INTERRUPT;
Reportor::Report(Reportor::Create(slaveConfig, SQLiteError::ErrNo(rc), "ErrorType: slaveBackupInterrupt"));
}
return rc == E_CANCEL ? E_CANCEL : SQLiteError::ErrNo(rc);
}

View File

@ -206,6 +206,8 @@ int SqliteStatement::Prepare(const std::string &sql)
if (errCode != E_OK) {
LOG_WARN("slave prepare Error:%{public}d", errCode);
SqliteUtils::SetSlaveInvalid(config_->GetPath());
RdbStoreConfig slaveConfig(SqliteUtils::GetSlavePath(config_->GetPath()));
Reportor::ReportFault(Reportor::Create(slaveConfig, errCode, "ErrorType: slavePrepareErr"));
}
}
return E_OK;
@ -247,6 +249,8 @@ int SqliteStatement::Bind(const std::vector<ValueObject> &args)
if (errCode != E_OK) {
LOG_ERROR("slave bind error:%{public}d", errCode);
SqliteUtils::SetSlaveInvalid(config_->GetPath());
RdbStoreConfig slaveConfig(SqliteUtils::GetSlavePath(config_->GetPath()));
Reportor::Report(Reportor::Create(slaveConfig, errCode, "ErrorType: slaveBindErr"));
}
}
return E_OK;
@ -387,6 +391,8 @@ int32_t SqliteStatement::Execute(const std::vector<std::reference_wrapper<ValueO
LOG_ERROR("slave execute error:%{public}d, sql is %{public}s, errno %{public}d",
errCode, sql_.c_str(), errno);
SqliteUtils::SetSlaveInvalid(config_->GetPath());
RdbStoreConfig slaveConfig(SqliteUtils::GetSlavePath(config_->GetPath()));
Reportor::Report(Reportor::Create(slaveConfig, errCode, "ErrorType: slaveExecErr"));
}
}
return E_OK;