[CBRD-27228] Fix/cbrd 27228 repl class interrupt assert - #7697
Open
youngjun9072 wants to merge 1 commit into
Open
[CBRD-27228] Fix/cbrd 27228 repl class interrupt assert#7697youngjun9072 wants to merge 1 commit into
youngjun9072 wants to merge 1 commit into
Conversation
… is interrupted 서버측 loaddb 대량 적재 중 적재를 중단(kill/시그널/killtran)하면 서버가 assert로 다운되는 문제 수정. 원인 (코어 분석으로 확정, err_id=-4): - CBRD-26246이 추가한 heap_is_replication_class()는 매 행 인덱스 반영 시 카탈로그에서 클래스 레코드를 fetch하는데, 트랜잭션에 인터럽트 표식이 서면 pgbuf_fix가 첫 관문에서 ER_INTERRUPTED로 fetch를 거절한다 (page_buffer.c의 인터럽트 검사). 이는 정상적인 중단 경로다. - 그런데 이 함수만 fetch 실패를 assert(false)로 '불가능'으로 취급해, 트랜잭션 롤백으로 끝나야 할 중단이 서버 abort가 됐다. - heap_get_class_record 호출부 28곳 중 실패를 assert(false)로 봉인한 곳은 이 함수가 유일하다. 나머지는 전부 에러로 정상 전파한다. 수정: - assert(false) -> assert(er_errid() == ER_INTERRUPTED). 인터럽트로 인한 실패만 정당한 것으로 허용하고 false를 반환한다 (트랜잭션이 곧 롤백되므로 복제 로그 생략은 정합성에 무해). 그 외의 실패는 여전히 debug에서 잡힌다. - 동일 파일 heap_file.c:3690에 같은 형태의 선례 assert가 있다. 재현: cubrid-testcases-private-ex의 issue_21654_server_side_loaddb (tran_info, signals) - 100만 행 서버측 적재 중 kill.
youngjun9072
requested review from
a team,
H2SU,
InChiJun,
YeunjunLee,
hgryoo,
lht1199 and
vimkim
August 13, 2026 08:32
🧪 TC Test Environment ReadyCircleCI Testing:
TC Repositories & Branches:
Next Steps:
|
Contributor
|
Reviews (1): Last reviewed commit: "[CBRD-27228] Do not abort the server whe..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<http://jira.cubrid.org/browse/CBRD-27228 >
Purpose
shell debug 테스트 중 발생하는 코어를 해결합니다.
Implementation
코어를 발생시킨 테스트에서는 실행 도중 인터럽트를 발생시키는데, pgbuf_fix() 함수는 페이지를 잡기 전에 먼저 인터럽트를 검사하여, 트랜잭션에 인터럽트가 걸려 있으면 ER_INTERRUPTED를 설정하고 NULL을 반환합니다. 하지만 이 로직을 호출한 부분에서는 heap_get_class_record() != S_SUCCESS로 전파된다.
여기까지는 문제의 소지가 없고 정상적으로 에러를 리턴하는 과정인데, 결과를 받는 heap_is_replication_class()에서는 에러일 경우 assert(false)로 무조건 실패로 처리하고있습니다.
이 문제를 해결하기위해 assert에서 ER_INTERRUPTED의 경우는 정상적으로 로직을 통과시키도록 수정합니다.
Remarks
유사 로직을 찾아봤는데, 해당 코드가 S_SUCCESS일 경우 assert(false)를 호출하는 경우는 이 코드 한곳입니다.