-
Notifications
You must be signed in to change notification settings - Fork 134
[CBRD-26374] Improve adaptive handling of loaddb compatibility options for versions with partial User Schema support #6677
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
base: develop
Are you sure you want to change the base?
Conversation
db_Statement_is_create를 추가해서 CREATE 구분
|
/run sql medium |
|
/run shell |
|
@codex review in korean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/loaddb/load_server_loader.cpp
Outdated
| #if defined(SERVER_MODE) | ||
| /* This is the case when the loaddb utility is executed with the --no-user-specified-name option as the dba user. */ | ||
| if (thread_ref.conn_entry->client_type == DB_CLIENT_TYPE_ADMIN_LOADDB_COMPAT) | ||
| if (thread_ref.conn_entry->client_type == DB_CLIENT_TYPE_ADMIN_LOADDB_COMPAT_UNDER_11_2) | ||
| { | ||
| found_again = locate_class_for_all_users (class_name, class_oid); | ||
| if (found_again == LC_CLASSNAME_EXIST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
서버 로더에서 갱신된 loaddb 클라이언트 타입 반영
loaddb가 CREATE 구문을 만나면 클라이언트 측에서 db_set_client_type으로 타입을 ADMIN_LOADDB_COMPAT_UNDER_11_4나 LOADDB_UTILITY로 바꾸지만, 서버 세션의 conn_entry->client_type은 초기 핸드셰이크 시점(network_interface_sr.c:640)에만 설정되고 이후 갱신되지 않습니다. 이 분기에서 여전히 UNDER_11_2로 간주되어 locate_class_for_all_users가 계속 호출되므로, 호환 모드를 끄기로 판단한 >=11.2/11.4 덤프에서도 다른 소유자의 클래스를 잘못 찾아버릴 수 있습니다.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objects 파일을 load 하는 경우에만 실행되는 코드이며,
object 파일의 class 이름에 '.'이 없는 경우에만 실행하도록 변경했습니다.
이 경우는 DB_CLIENT_TYPE_ADMIN_LOADDB_COMPAT_UNDER_11_2 클라이언트 동작과 일치합니다.
0cc6d6e에서 변경했습니다.
|
/run sql medium |
|
/run shell |
|
/run sql medium |
|
@codex review in korean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (db_get_client_type() == DB_CLIENT_TYPE_ADMIN_LOADDB_COMPAT_UNDER_11_2) | ||
| { | ||
| /* Called by ldr_sa_load or ldr_server_load to load an object file; DDL must not be executed. */ | ||
| assert (db_get_client_statement_type () == CUBRID_STMT_NONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
호환 모드에서 ldr_exec_query_from_file는 각 DDL마다 db_set_client_statement_type을 갱신하지만 종료 시점을 막아주는 초기화가 없어 마지막 문장이 CREATE_*로 끝나면 타입이 그대로 남습니다. 바로 이어지는 객체 파일 로딩에서 ldr_find_class(lines 1449-1452)가 db_get_client_statement_type() == CUBRID_STMT_NONE를 단정하고 있어, 스키마 파일 끝이 CREATE 문인 흔한 경우(예: COMMIT 문이 없는 스크립트) 디버그 빌드에서는 데이터 로드 진입 즉시 abort가 발생합니다. 데이터 로드를 시작하기 전에 statement 타입을 리셋하거나 assert 조건을 완화하지 않으면 호환 모드에서 쉽게 재현됩니다.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2e050a6에서 해결했습니다.
|
/run sql medium |
|
/run sql medium |
|
/run shell |
|
/run sql medium |
|
/run sql medium |
|
/run shell |
http://jira.cubrid.org/browse/CBRD-26374
Purpose
unload 파일에는 unload 시점의 버전 정보가 없어
load 시 --no-user-specified-name 옵션의 필요 여부를 판단하기 어렵습니다.
이 변경에서는 load 과정에서 unload 시점의 버전을 추정해
필요한 경우에만 --no-user-specified-name 옵션이 적용되도록 개선합니다.
또한 11.2 이상, 11.4 미만 버전에서 unload 받은 파일을 load 할 때,
저장 프로시저에 대해서만 부분적으로 옵션이 활성화되는 동작을 지원합니다.
Implementation
client_type, statement_type 기반 호환성 단계 관리
해당 객체 타입이 사용자 스키마를 지원하는 버전에서 unload 받은 것으로 간주
online _objects load
호환성 옵션 적용 대상
호환성 단계 전환 조건
안전 장치
다른 스키마 객체 검색을 수행하지 않음
Remarks
N/A