Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
empiredan committed Nov 21, 2024
1 parent 2a8df3c commit 10e0eca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3098,6 +3098,8 @@ void server_state::set_app_envs(const app_env_rpc &env_rpc)
}

const auto &old_envs = dsn::utils::kv_map_to_string(app->envs, ',', '=');

// Update envs of local memory.
for (size_t idx = 0; idx < keys.size(); ++idx) {
app->envs[keys[idx]] = values[idx];
}
Expand Down
7 changes: 6 additions & 1 deletion src/meta/test/server_state_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class server_state_test
ASSERT_EQ(dsn::ERR_OK, _ss->sync_apps_to_remote_storage());
}

std::shared_ptr<app_state> get_app(const std::string &app_name)
std::shared_ptr<app_state> get_app(const std::string &app_name) const
{
return _ss->get_app(app_name);
}
Expand Down Expand Up @@ -240,14 +240,19 @@ void meta_service_test_app::app_envs_basic_test()
fail::teardown(); \
} while (0)

// Failed to setting envs while table was not found.
TEST_SET_APP_ENVS_FAILED(not_found, ERR_APP_NOT_EXIST);

// Failed to setting envs while table was being dropped as the intermediate state.
TEST_SET_APP_ENVS_FAILED(dropping, ERR_BUSY_DROPPING);

// The table was found dropped after the new envs have been persistent on the remote
// meta storage.
TEST_SET_APP_ENVS_FAILED(dropped_after, ERR_APP_DROPPED);

#undef TEST_SET_APP_ENVS_FAILED

// Normal case for setting envs.
std::cout << "test server_state::set_app_envs()..." << std::endl;
{
configuration_update_app_env_request request;
Expand Down

0 comments on commit 10e0eca

Please sign in to comment.