File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -430,16 +430,19 @@ bool ClusterSDK::BuildCatalog() {
430430 return false ;
431431 }
432432 } else {
433- DLOG (INFO) << " no procedures in db" ;
433+ LOG (INFO) << " no procedures in db" ;
434434 }
435+ // The empty database can't be find if we only get table datas, but database no notify, so we get alldbs from
436+ // nameserver in GetAllDbs()
435437 return UpdateCatalog (table_datas, sp_datas);
436438}
437439
438440std::vector<std::string> DBSDK::GetAllDbs () {
439- std::lock_guard<::openmldb::base::SpinMutex> lock (mu_);
440441 std::vector<std::string> all_dbs;
441- for (auto db_name_iter = table_to_tablets_.begin (); db_name_iter != table_to_tablets_.end (); db_name_iter++) {
442- all_dbs.push_back (db_name_iter->first );
442+ std::string st;
443+ if (!GetNsClient ()->ShowDatabase (&all_dbs, st)) {
444+ LOG (WARNING) << " show db from ns failed, msg: " << st;
445+ return {};
443446 }
444447 return all_dbs;
445448}
You can’t perform that action at this time.
0 commit comments