Skip to content

Commit

Permalink
fix show storage policy null pointer and redundant log (apache#10906)
Browse files Browse the repository at this point in the history
* fix show storage policy null pointer and redundant log
  • Loading branch information
deardeng authored Jul 18, 2022
1 parent 77ef19d commit 8c544b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions be/src/agent/task_worker_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,7 @@ void TaskWorkerPool::_storage_refresh_storage_policy_worker_thread_callback() {

TGetStoragePolicyResult result;
Status status = _master_client->refresh_storage_policy(&result);
if (!status.ok()) {
LOG(WARNING) << "refresh storage policy status not ok";
} else if (result.status.status_code != TStatusCode::OK) {
// LOG(WARNING) << "refresh storage policy result status status_code not ok";
} else {
if (status.ok() && result.status.status_code == TStatusCode::OK) {
// update storage policy mgr.
StoragePolicyMgr* spm = ExecEnv::GetInstance()->storage_policy_mgr();
for (const auto& iter : result.result_entrys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2869,7 +2869,7 @@ public static void getDdlStmt(DdlStmt ddlStmt, String dbName, TableIf table, Lis
}

// storage policy
if (!olapTable.getStoragePolicy().equals("")) {
if (olapTable.getStoragePolicy() != null && !olapTable.getStoragePolicy().equals("")) {
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY).append("\" = \"");
sb.append(olapTable.getStoragePolicy()).append("\"");
}
Expand Down

0 comments on commit 8c544b6

Please sign in to comment.