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-25768] Separate server requests to the master between the server and the client #5751

Merged
merged 3 commits into from
Jan 4, 2025

Conversation

YeunjunLee
Copy link
Contributor

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

  • Purpose

    • css_register_new_server는 새로운 server process의 정보를 받아, cub_master에 등록하는 함수
    • 이 함수를 통해 css_accept_new_reqeust함수를 호출하여 packing 된 정보를 해체하여 cub_master에 정보를 등록한다. 이러한 상황은 두 가지로 분류된다.
        1. 새로운 Server가 등록되는 경우, server process는 CSS_SERVER_PROC_REGISTER 자료구조에 정보를 담아서 master에 정보를 보낸다.
        1. copylogdb, applylogdb와 같은 client-side process가 등록되는 경우, server name만 master에 전송된다.
  • 위 두 상황은 서로 다른 format임에도 불구하고, 같은 request code인 SERVER_REQUEST로 전송되고 있다.

  • Implementation

    • SERVER_REQUEST 요청의 분리
      • 새로운 Server가 등록되는 경우, SERVER_REQUEST_FROM_SERVER request를 통해 요청 전송
      • client process의 경우, SERVER_REQUEST_FROM_CLIENT request를 통해 요청 전송
    • 요청 처리 함수의 변경
      • 요청을 받는 함수인 css_register_new_server와, 정보를 unpack 하는 함수인 css_accept_new_reqeustis_client 변수를 추가로 받도록 변경하여, 다루고 있는 process가 client 인지 정보를 추가로 전달
      • client 정보라면, 전달 받은 buffer를 그대로 server name으로 인식하고, server라면, 전달 받은 bufferCSS_SERVER_PROC_REGISTER로 변환하여 정보를 unpack 한다.

@YeunjunLee YeunjunLee self-assigned this Dec 30, 2024
@YeunjunLee YeunjunLee marked this pull request as ready for review December 30, 2024 07:25
SERVER_REQUEST_NEW = 5, /* new-style server request */
SERVER_REQUEST_FROM_SERVER = 3, /* let new server attach */
SERVER_REQUEST_FROM_CLIENT = 4, /* let new client process attach */
UNUSED_REQUEST = 5, /* unused request - leave it for compatibility */
Copy link
Contributor

Choose a reason for hiding this comment

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

호환성을 위해 유지해야 한다면, 5가 아니라 4로 유지해야 할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UNUSED_REQUEST를 제거하여서 호환성을 유지하도록 변경하였습니다.

}
else
{
proc_register = (CSS_SERVER_PROC_REGISTER *) buffer;
Copy link
Contributor

Choose a reason for hiding this comment

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

buffer가 NULL인지 체크할 필요가 있지 않나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assertion을 추가하였습니다.

proc_register = (CSS_SERVER_PROC_REGISTER *) buffer;
server_name = proc_register->server_name;
server_name_length = proc_register->server_name_length;
}
length = (int) strlen (server_name) + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

server_name이 NULL인 경우에 대해 처리가 필요할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assertion을 추가하였습니다.

@YeunjunLee YeunjunLee requested a review from beyondykk9 January 2, 2025 05:39
@hornetmj hornetmj merged commit 2aa1f07 into CUBRID:develop Jan 4, 2025
9 of 10 checks passed
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.

5 participants