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-25028] Disable heap_chnguess_realloc() function, which is inaccessible from heap_Guesschn #5688

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

InChiJun
Copy link

@InChiJun InChiJun commented Dec 9, 2024

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

Purpose

  • insert/delete/update 작업을 할 때 heap_Guesschn 캐시에 정보를 가져오거나 넣는다.
  • 이때 조건에 따라 heap_chnguess_realloc() 함수를 실행시킨다.
  • 이 조건은 (heap_Guesschn->num_clients <= tran_index) 인데, heap_Guesschn->num_clients 값은 부팅 과정에서 MAX_NTRANS로 초기화되고, tran_index 값은 MAX_NTRANS보다 작은 값으로 고정되기 때문에 해당 조건은 실행될 수 없다.

Implementation

  • 접근할 수 없는 heap_chnguess_realloc() 함수 비활성화

Remarks

  • N/A

@InChiJun InChiJun requested review from H2SU and YeunjunLee December 9, 2024 02:06
@InChiJun InChiJun self-assigned this Dec 9, 2024
@InChiJun InChiJun requested a review from hornetmj as a code owner December 9, 2024 02:06
Copy link
Contributor

@H2SU H2SU left a comment

Choose a reason for hiding this comment

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

어떤 과정에 의해 num_clients 값이 MAX_NTRANS 값으로 초기화되는지 궁금합니다.

static int heap_chnguess_realloc (void);
#endif /* #if defined (ENABLE_UNUSED_FUNCTION) */
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. #if defined 구문이 바로 위에 있기 때문에 주석을 통한 정보 제공이 불필요하다고 생각합니다.

Suggested change
#endif /* #if defined (ENABLE_UNUSED_FUNCTION) */
#endif

@@ -670,7 +670,7 @@ static int heap_scancache_end_internal (THREAD_ENTRY * thread_p, HEAP_SCANCACHE
#if defined (ENABLE_UNUSED_FUNCTION)
static SCAN_CODE heap_get_if_diff_chn (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, INT16 slotid, RECDES * recdes,
bool ispeeking, int chn, MVCC_SNAPSHOT * mvcc_snapshot);
#endif /* ENABLE_UNUSED_FUNCTION */
Copy link
Contributor

Choose a reason for hiding this comment

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

어떤 #if 매크로와 쌍인지 쉽게 인지하기 위해서 #endif /* */ 형식을 권장합니다. 따라서, 제거하지 말아주세요. 또한 추가하신 %if ~ #endif의 #endif에도 적용해 주세요.

Copy link
Author

Choose a reason for hiding this comment

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

적용했습니다.

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.

4 participants