Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-25603] Revive cub_server that is started by cubrid server start command #5534

Open
wants to merge 2 commits into
base: feature/server_revive_2
Choose a base branch
from

Conversation

YeunjunLee
Copy link
Contributor

http://jira.cubrid.org/browse/CBRD-25603

  • Purpose

    • cubrid server start를 통해 구동된 cub_server의 경우, 120초 이내에 kill 되더라도, 재구동 되어야 한다.
  • Implementation

    • 비정상 종료된 cub_server의 경우 server_entry를 제거하지 않고, 정상적으로 종료된 cub_server의 경우에만 server_entry를 제거하기 때문에, cubrid server start를 통해 cub_server 가 구동되는 경우에만 새로운 server_entry가 생성된다.
    • 새로운 server_entry를 생성하는 경우에는 std::chrono::steady_clock::time_point()를 통해 null time을 삽입하고, revive job에서 이를 확인하는 과정을 통해 timediff가 120초를 넘지 않아도 재구동을 시키도록 조건문을 변경한다.

@YeunjunLee YeunjunLee self-assigned this Oct 10, 2024
@YeunjunLee YeunjunLee marked this pull request as ready for review October 10, 2024 04:59
@mhoh3963 mhoh3963 deleted the branch CUBRID:feature/server_revive_2 October 10, 2024 23:44
@mhoh3963 mhoh3963 closed this Oct 10, 2024
@YeunjunLee YeunjunLee reopened this Oct 11, 2024
@@ -171,7 +171,8 @@ server_monitor::revive_server (const std::string &server_name)
// true after the first evaluation. Therefore, evaluating the timediff only once when producing the REVIVE_SERVER job is needed.
// (Currently, it is impossible since registered_time is stored in server_entry, which is not synchronized structure between monitor and main thread.)

if (timediff > SERVER_MONITOR_UNACCEPTABLE_REVIVE_TIMEDIFF_IN_SECS)
if (entry->second.get_registered_time() == std::chrono::steady_clock::time_point ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. registered_time라는 표현이 더이상 유효하지 않습니다.
    • last_revived_time 등의 표기가 더 적합하다고 봅니다.
    • 멤버 변수, 함수 반영
  2. 여기서 m_registered_time의 값을 결정하기 보다는 timediff를 구할 때 반영하는게 문맥 이해가 쉬울 것 같습니다.
    • if (entry->second.get_registered_time() == std::chrono::steady_clock::time_point ()) timediff = SERVER_MONITOR_UNACCEPTABLE_REVIVE_TIMEDIFF_IN_SECS + 1; 등
    • 또는 bool is_first_try = entry->second.get_registered_time() == std::chrono::steady_clock::time_point ()) timediff; (저는 이것이 더 명확해 보이네요.)
      • if (is_first_try || timediff > SERVER_MONITOR_UNACCEPTABLE_REVIVE_TIMEDIFF_IN_SECS) 등

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. last_revived_time으로 멤버 변수와 함수에 모두 변경하였습니다.
  2. is_first_try보단 revived_before = entry->second.get_registered_time() != std::chrono::steady_clock::time_point () 가 더 적합한 표현이라고 생각합니다. 이와 같이 변경하였습니다. 해당 부분은 timediff를 구하는 부분으로 이동하였습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants