-
Notifications
You must be signed in to change notification settings - Fork 43
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-25241] Add SQL syntax to change the owner of the serial #1904
base: develop
Are you sure you want to change the base?
Conversation
/* ------------------------------------------------------------------------------------*/ | ||
/* 5. HA synchronization test */ | ||
/* 5-1. master node - add test_user2 as a member to test_user1 group */ | ||
/* ------------------------------------------------------------------------------------*/ |
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.
주석에 HA 동기화 테스트라고 되어 있는데...
HA 동기화 테스트는 SQL 카테고리에서 확인이 불가합니다.
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.
http://jira.cubrid.org/browse/CBRD-25241 내에 "CBRD-25241_TEST-CASE_20240429.sql"파일을 가지고
test case를 생성 했습니다.
승일님, 시온님이 SELECT문만 발췌하여 slave서버로 보내서 확인한다고 하던데요.
그래서 SQL 카테고리에서 작성했습니다.
승일님, 다시 한번 답변 달아주시면 좋겠습니다.
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.
HA 기능 테스트가 아니고 동기화 여부 테스트이므로 sql 카테고리에 추가하는 것이 맞을 것 같습니다.
sql 카테고리에 있는 tc는 ha_repl 테스트 카테고리에서 동기화 테스트의 tc로 사용됩니다.
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.
추가로 본 PR의 tc 및 ha_repl 소스를 확인해보니 tc를 분리할 필요가 있어 보입니다.
ha_repl은 .sql 파싱 단계에서 DDL, DML이 아닌 것은 실행하지 않도록 하고 있습니다.
제외 대상은 AUTOCOMMIT, ROLLBACK, COMMIT, $, SHOW, CALL, SELECT 입니다.
ha 환경에서 위 제외 대상의 사용이 꼭 필요한 경우에는 ha_shell tc로 작성할 필요가 있습니다.
본 PR의 tc를 확인해보니 call login문에 의한 사용자 변경 작업이 포함되어 있습니다.
따라서 신규로 추가된 syntax 인 'alter serial ... OWNER TO ...' 를 검증하기 위한 sql tc와 복제 여부를 확인하기 위한 ha_shell tc를 분리 작성하는 것이 바람직해보입니다.
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.
정정합니다.
TC 전체를 보기전에 위 코멘트(tc 분리)를 남겼는데, 전체를 확인해보니 HA 관련 테스트로 지정하고 있는 것은 마지막 5번 시나리오(5. HA synchronization test)네요.
call login 구문은 2번 시나리오( 2. alter serial owner to permission check)에 포함되어 있습니다.
만일 call login이 포함된 시나리오도 HA환경에서의 검증하고자 한다면 ha_shell tc를 따로 작성이 필요하고, 5번 시나리오만 HA환경에서의 검증하면 된다면 tc 분리는 필요 없을 것 같습니다.
제 의견은 call login이 포함된 시나리오를 HA 환경에서 별도 검증할 필요는 없어 보입니다.
@kwonhoil 의견 부탁 드립니다.
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.
testcase "2. alter serial owner to permission check" 시나리오 모두 삭제 하겠습니다.
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.
testcase "2. alter serial owner to permission check" 시나리오를 삭제하는 것이 좋은 방법은 아닌것 같습니다.
승일님 의견과 동일하게 2번 시나리오를 HA 환경에서 별도 검증할 필요는 없어 보입니다.
따라서, call login이 포함된 시나리오는 HA환경에서 검증은 안해도 됩니다.
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.
testcase "2. alter serial owner to permission check" 시나리오 원상 복귀 했습니다.
create user test_user1; | ||
|
||
create serial cubrid_seq; | ||
select unique_name, name, owner.name, [comment] from db_serial where name = 'cubrid_seq'; |
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.
해당 쿼리의 결과를 .sql에 작성한 이유가 무엇인가요?
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.
http://jira.cubrid.org/browse/CBRD-25241 내에 "CBRD-25241_TEST-CASE_20240429.sql"파일을 가지고
test case를 생성 했습니다.
/* | ||
unique_name name owner.name comment | ||
======================================================================================== | ||
'dba.cubrid_seq' 'cubrid_seq' 'DBA' NULL | ||
*/ |
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.
주석을 남기는 것은 test를 이해하는데 필요한 경우가 일반적입니다.
정상적인 select 결과의 경우 answer file에서 확인 가능하므로 sql file에서는 제거하는 것이 좋을 것 같습니다.
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.
삭제 하였습니다.
/* ------------------------------------------------------------------------------------*/ | ||
/* 5. HA synchronization test */ | ||
/* 5-1. master node - add test_user2 as a member to test_user1 group */ | ||
/* ------------------------------------------------------------------------------------*/ |
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.
정정합니다.
TC 전체를 보기전에 위 코멘트(tc 분리)를 남겼는데, 전체를 확인해보니 HA 관련 테스트로 지정하고 있는 것은 마지막 5번 시나리오(5. HA synchronization test)네요.
call login 구문은 2번 시나리오( 2. alter serial owner to permission check)에 포함되어 있습니다.
만일 call login이 포함된 시나리오도 HA환경에서의 검증하고자 한다면 ha_shell tc를 따로 작성이 필요하고, 5번 시나리오만 HA환경에서의 검증하면 된다면 tc 분리는 필요 없을 것 같습니다.
제 의견은 call login이 포함된 시나리오를 HA 환경에서 별도 검증할 필요는 없어 보입니다.
@kwonhoil 의견 부탁 드립니다.
'test_user1.cubrid_seq' 'cubrid_seq' 'TEST_USER1' 5 5 NULL | ||
*/ | ||
|
||
/* 5-2. slave node - check whether the ADD MEMBERS syntax is synchronized. */ |
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.
slave node에서 체크 구문은 불필요하므로 삭제하는 것이 좋겠습니다.
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.
title "5. HA synchronization test" tc 시나리오 5-2, 5-4 를 삭제 하겠습니다.
그리고, "5. HA synchronization test" --> " 5. add test_user2 as a member to test_user1 group, delete member test_user2 in test_user1 group" 변경 합니다.
0 row selected. (0.002959 sec) Committed. (0.000079 sec) | ||
*/ | ||
|
||
/* 5-4. slave node - check whether the DROP MEMBERS syntax is synchronized. */ |
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.
slave node에서 체크 구문은 불필요하므로 삭제하는 것이 좋겠습니다.
serial cache 관련 TC도 추가가 필요해 보입니다. create user test_user1;
create user test_user2;
create serial test_user1.cubrid_seq cache 5;
SELECT test_user1.cubrid_seq.nextval from dual;
/*
serial_next_value(cubrid_seq, 1)
======================
1
*/
alter serial test_user1.cubrid_seq OWNER TO test_user2;
SELECT unique_name, name, owner.name, current_val, cached_num, [comment] FROM db_serial WHERE name = 'cubrid_seq';
/*
unique_name name owner.name current_val cached_num comment
===========================================================================================================================
'test_user2.cubrid_seq' 'cubrid_seq' 'TEST_USER2' 5 5 NULL
*/
SELECT test_user2.cubrid_seq.nextval from dual;
/*
serial_next_value(test_user2.cubrid_seq, 1)
======================
6
*/
alter serial test_user2.cubrid_seq comment 'test comment';
SELECT unique_name, name, owner.name, current_val, cached_num, [comment] FROM db_serial WHERE name = 'cubrid_seq';
/*
unique_name name owner.name current_val cached_num comment
===========================================================================================================================
'test_user2.cubrid_seq' 'cubrid_seq' 'TEST_USER2' 10 5 'test comment'
*/
SELECT test_user2.cubrid_seq.nextval from dual;
/*
serial_next_value(test_user2.cubrid_seq, 1)
======================
11
*/ |
@jongmin-won |
…ial owner to permission check.'
Refer to : http://jira.cubrid.org/browse/CBRD-25241
serial를 생성하고, 특정 serial에 대해 "alter serial"로 다른 사용자(owner)로 변경 시 에러 발생
serial owner가 변경됐는지 확인함. 또한 다양한 테스트 케이스 반영
5-1. master node - add test_user2 as a member to test_user1 group
5-2. slave node - check whether the ADD MEMBERS syntax is synchronized.
5-3. master node - delete member test_user2 in test_user1 group
5-4. slave node - check whether the DROP MEMBERS syntax is synchronized.