Skip to content

[CBRD-26477] Implement LOB file move instead of copy during INSERT#6886

Merged
InChiJun merged 66 commits intoCUBRID:developfrom
InChiJun:CBRD-26477
Mar 27, 2026
Merged

[CBRD-26477] Implement LOB file move instead of copy during INSERT#6886
InChiJun merged 66 commits intoCUBRID:developfrom
InChiJun:CBRD-26477

Conversation

@InChiJun
Copy link
Copy Markdown
Contributor

@InChiJun InChiJun commented Mar 3, 2026

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

Purpose

#6833 이후 서브 이슈로 진행되는 PR입니다.

LOB 데이터 삽입 시 temp file을 copy하지 않고 move 하도록 합니다.

  • 특수 케이스(UPDATE)에서는 copy를 수행합니다.(특수 케이스에 대한 설명은 이슈 description 참고하시면 됩니다.)

Implementation

#6833 의 구현은 db_elo_copy_with_prefix() ~> xes_posix_copy_file_with_prefix() 로 수행되는 콜스택 하나만 존재했습니다.
이 PR에서는 elo_copy_with_prefix() 함수를 수정하여 STATE에 따라 move/copy 동작으로 분기하도록 구현하였습니다.

AS-IS

-> STATE에 상관 없이 copy 동작만 수행

TO-BE

-> STATE에 따라 다른 동작(각 STATE의 상황은 이슈 description을 참고하시면 됩니다.)

  • LOB_TRANSIENT_CREATED / LOB_PERMANENT_DELETED -> move file 수행
  • LOB_PERMANENT_CREATED / LOB_NOT_FOUND -> copy file 수행

Remarks

이 PR의 core를 담당하는 db_elo_copy_with_prefix() 함수 외에 다른 함수도 수정되었습니다.

  1. 지난 PR에서 commit 순서가 꼬여서 반영되지 않은 코드를 반영하였습니다.
  2. 추가로 리팩토링이 필요한 부분은 리팩토링을 수행하였습니다.

slob_remove_dir()
-> 반영되지 않은 commit 반영

lob_process_dir_add_attr()
-> 함수명 변경
-> 로직 변경 (lob_attrid_arr_length는 2 이하일 가능성이 높기 때문에, 조건문 순서를 우선으로 변경)
-> 코드 가독성 (중복된 for문을 한 곳에서 수행하도록 변경)

lob_process_dir_drop_attr()
-> 함수명 변경

locator_lob_process_dir()
-> 로직 변경 (lob_attrid_arr_length는 2 이하일 가능성이 높기 때문에, 조건문 순서를 우선으로 변경)
-> 코드 가독성 (중복된 for문을 한 곳에서 수행하도록 변경)

@InChiJun InChiJun self-assigned this Mar 3, 2026
@InChiJun InChiJun marked this pull request as ready for review March 3, 2026 07:37
@InChiJun InChiJun removed the request for review from beyondykk9 March 3, 2026 07:37
@InChiJun
Copy link
Copy Markdown
Contributor Author

InChiJun commented Mar 3, 2026

/run all

@InChiJun
Copy link
Copy Markdown
Contributor Author

InChiJun commented Mar 3, 2026

/run all

@InChiJun
Copy link
Copy Markdown
Contributor Author

InChiJun commented Mar 3, 2026

/run all

@InChiJun
Copy link
Copy Markdown
Contributor Author

InChiJun commented Mar 3, 2026

참고

  1. shell 테스트 실패 항목은 로컬에서 수행해보았고, 통과하였습니다.
  2. code-style의 경우 제가 수정하지 않은 곳에서 발생하고 있어서, 리뷰 후에 반영하는 것으로 하겠습니다.

@InChiJun InChiJun reopened this Mar 24, 2026
@github-actions
Copy link
Copy Markdown

🗑️ TC Branch Finalized for cubrid-testcases-private-ex

Engine PR was closed (not merged).

Cleanup Results:

TC develop branch is ready for the next PR.

@github-actions
Copy link
Copy Markdown

🗑️ TC Branch Finalized for cubrid-testcases

Engine PR was closed (not merged).

Cleanup Results:

TC develop branch is ready for the next PR.

@github-actions
Copy link
Copy Markdown

🧪 TC Test Environment Ready

CircleCI Testing:

  • CircleCI will automatically test using the branches below.

TC Repositories & Branches:

Next Steps:

  1. Wait for CircleCI tests to complete
  2. If CircleCI tests failed, please check the test results and fix the issues.
  3. When ready to merge this PR, please merge the TC PR first, then merge this PR.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 24, 2026

Reviews (24): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile

@InChiJun
Copy link
Copy Markdown
Contributor Author

/run all

Comment thread src/communication/network_interface_sr.cpp Outdated
Comment thread src/transaction/locator_cl.c
Comment thread src/transaction/locator_cl.c Outdated
Comment thread src/transaction/locator_cl.c
Comment thread src/transaction/locator_cl.c
Comment thread src/transaction/locator_sr.c Outdated
Comment thread src/query/execute_schema.c
Comment thread src/query/execute_schema.c Outdated
Comment thread src/object/object_representation.c Outdated
Comment thread src/object/object_representation.c Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 26, 2026

Reviews (25): Last reviewed commit: "refactor slob_*_dir()" | Re-trigger Greptile

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 26, 2026

Important Files Changed

Filename Overview
src/communication/network_interface_sr.cpp slob_create_dir에서 or_unpack_int 결과를 null 체크 없이 or_unpack_int_array에 직접 체이닝하는 NPE 위험 존재. slob_remove_dir 단순화는 이전 스레드 결정과 일관성 있으나 create_dir는 체이닝 구조로 질적으로 다름.
src/object/elo.c elo_copy_with_prefix가 LOB 상태에 따라 move/copy로 분기하도록 재구현됨. 이전 리뷰 피드백(real_locator 사용, er_set, es_delete_file 정리 등)이 대부분 반영되어 구현 품질이 개선됨.
src/storage/es_posix.c xes_posix_move_file_with_prefix 신규 함수 추가. 이전 리뷰 피드백(er_set_with_oserror, snprintf truncation 검사, 로그 메시지 수정 등)이 모두 반영됨.
src/storage/es.c es_move_file_with_prefix 신규 함수 추가 및 es_rename_file 로그 메시지 수정. 이전 리뷰 피드백이 정확히 반영됨.
src/transaction/locator_cl.c locator_lob_create_or_remove_dir 리팩토링으로 truncate 케이스에서 중복 lob_remove_dir 호출 제거. locator_remove_class에서 lob_attrid_arr_length=0→1 버그 수정.
src/query/execute_schema.c lob_process_dir_drop_attr에서 lob_attrid_arr_length=0→1 버그 수정, malloc 실패 시 er_set 추가. 중복 for-loop 통합으로 가독성 개선.

Reviews (28): Last reviewed commit: "Remove unnecessary call assert()" | Re-trigger Greptile

Comment thread src/storage/es_posix.c
@InChiJun
Copy link
Copy Markdown
Contributor Author

/run all

@InChiJun InChiJun merged commit 4a7c670 into CUBRID:develop Mar 27, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown

TC Branch Finalized for cubrid-testcases

Engine PR was merged.

Cleanup Results:

TC base branch is ready for the next PR.

@github-actions
Copy link
Copy Markdown

TC Branch Finalized for cubrid-testcases-private-ex

Engine PR was merged.

Cleanup Results:

TC base branch is ready for the next PR.

hyunikn added a commit to hyunikn/cubrid that referenced this pull request Mar 27, 2026
hyunikn added a commit to hyunikn/cubrid that referenced this pull request Mar 27, 2026
kwangsoochae pushed a commit to kwangsoochae/cubrid that referenced this pull request Apr 1, 2026
…UBRID#6886)

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

Modified LOB data insertion to perform a move operation rather than a copy operation.
hgryoo pushed a commit to cubrid-systems/cubrid that referenced this pull request Apr 8, 2026
…UBRID#6886)

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

Modified LOB data insertion to perform a move operation rather than a copy operation.
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.

9 participants