!1764 【RDB】sqlite双写补充打点上报场景

Merge pull request !1764 from linzhuobin1/dw-dfx
This commit is contained in:
openharmony_ci 2024-11-22 02:13:49 +00:00 committed by Gitee
commit 7d342ca7da
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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;