Repository navigation
[CBRD-26062] Add SIGUSR1-triggered memory dump of logwr_Gl (copylogdb) and la_Info (applylogdb) - #6211
Conversation
|
SIGUSR1,2로 프로세스의 상태를 확인할 수 있다면 좋겠다고 생각했는데, 마침 구현해주셔서 감사합니다! 좋은 방법입니다! |
There was a problem hiding this comment.
signal은 timing을 예측할 수 없으므로 async signal safe 함수들을 사용하셔야 할 것 같습니다.
printf는 버전에 따라 내부 구현이 다르므로 전역 변수 의존성을 가지는 지, malloc 등의 할당을 호출하는 지 알 수 없습니다.
printf를 처리하던 도중 들어온 signal handler에서 printf를 다시 호출할 경우 buffer가 꼬일 수 있습니다. 또 malloc을 처리하던 도중에 handler에서 malloc을 호출할경우 mutex 경합으로 인해 멈출 수 있습니다.
실제 구현 상 위험할지는 모르겠으나 현재 printf family (printf, sprintf, dprintf)는 async signal safe를 보장하지 않으므로 버퍼가 따로 없는 write 등의 저수준 출력으로 교체하시는 게 좋을 것 같습니다.
EDIT:
dump 스레드 자체는 blocking으로 돌고 있으므로 signal이 확실히 해당 스레드로 간다는 보장만 있으면 문제 없겠네요!
|
/run all |
|
/run shell |
|
Reviews (1): Last reviewed commit: "Merge branch 'CUBRID:develop' into CBRD-..." | Re-trigger Greptile |
copylogdb/applylogdb의 SIGUSR1 처리를 self-pipe 기반으로 바꾸고, stdout이 /dev/null로 재지정되는 릴리스 경로에서도 원래 stdout으로 덤프가 남도록 출력 스트림을 전달한다. 초기화 전/종료 중 SIGUSR1이나 스레드 생성 실패가 유효하지 않은 pthread_t 사용 또는 NULL 역참조로 이어지지 않도록 start/stop guard와 NULL-safe dump를 함께 적용했다. Constraint: SIGUSR1 handler에서는 async-signal-safe 함수만 호출해야 함 Rejected: fprintf를 signal handler에서 직접 호출 | stdio/malloc lock 경합 위험 Rejected: pthread_sigmask + sigwait 유지 | 이미 생성된 HA 스레드가 SIGUSR1을 받을 수 있는 타이밍 위험 Confidence: high Scope-risk: moderate Directive: SIGUSR1 handler에 printf 계열 또는 malloc 가능 함수를 추가하지 말 것 Tested: ninja -C build_preset_debug cs/CMakeFiles/cubridcs.dir/__/src/executables/util_cs.c.o cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_writer.c.o cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_applier.c.o Not-tested: pthread_create 실패를 강제로 주입한 런타임 경로
SIGUSR1 덤프가 구조체 원시 값 위주라 copy/apply 진행 간격, 미flush 페이지, replication filter 같은 현장 triage 정보가 바로 드러나지 않았다. support_summary를 먼저 출력하고 누락된 log header/apply state 필드를 풀어서 로그만으로 병목 지점을 판단할 수 있게 했다. Constraint: 현장 기술지원은 장애 시점의 stdout 덤프만으로 copylogdb/applylogdb 상태를 판단해야 함 Rejected: 포인터와 원시 필드만 추가 출력 | 복제 지연 원인 분류에 필요한 계산 지표가 부족함 Confidence: high Scope-risk: narrow Directive: support_summary 필드는 원본 상세 필드와 함께 유지해 빠른 triage와 정밀 분석을 모두 지원할 것 Tested: ninja -C build_preset_debug cub_admin cub_master cub_server csql Tested: SIGUSR1 runtime dump smoke test for copylogdb/applylogdb in /tmp/cubrid-cbrd26062-newfields2 Not-tested: two-node production HA topology under sustained write load
✅ TC Merge Gate — Merge AllowedAll TC PRs are merged, closed, or not present. TC Repositories & Branches:
|
|
Reviews (2): Last reviewed commit: "기술지원이 복제 지연 원인을 빠르게 좁히도록 덤프를 보강" | Re-trigger Greptile |
|
/run all |
Merge latest upstream/develop so CircleCI uses engine behavior matching the current SQL and shell test answers while preserving the SIGUSR1 diagnostic dump changes. Constraint: CircleCI test_sql/test_shell were running current testcase answers against a PR branch behind develop by 50 commits. Rejected: update answer files for PR 6211 failures | failures match missing develop behavior, not SIGUSR1 dump output changes. Confidence: high Scope-risk: moderate Directive: Re-run CircleCI after this merge before investigating PR-specific regressions. Tested: cmake --preset debug Tested: cmake --build build_preset_debug --target cub_admin cub_master cub_server csql cs/CMakeFiles/cubridcs.dir/__/src/executables/util_cs.c.o cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_writer.c.o cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_applier.c.o Tested: bash -ic 'bd' Not-tested: release build and CircleCI rerun before push Co-authored-by: OmX <omx@oh-my-codex.dev>
|
Reviews (3): Last reviewed commit: "Bring PR branch up to current develop fo..." | Re-trigger Greptile |
Remove an extra closing-brace line from logwr_dump_logwr_gl_topfields() so the helper only emits fields belonging to the enclosing logwr_global block. Constraint: Greptile review identified malformed diagnostic output after the develop merge. Rejected: Add another wrapper block around top fields | would change the existing dump shape more broadly than needed. Confidence: high Scope-risk: narrow Directive: Keep helper dump functions from closing containers opened by their callers. Tested: bash -ic 'bd' Not-tested: runtime SIGUSR1 dump capture after this one-line formatting fix Co-authored-by: OmX <omx@oh-my-codex.dev>
CircleCI checks out pull/6211 with the fork head SHA but fetches the base repository refs first; the base repository PR head ref is stale, so the fork-only SHA was unavailable during checkout. Constraint: CircleCI retry API is not available from this environment, and CUBRID/cubrid refs/pull/6211/head remains at 533040e. Rejected: Wait for GitHub pull ref propagation | the pull head ref stayed stale across multiple pushed commits. Confidence: medium Scope-risk: narrow Directive: Keep CUBRID/cubrid CBRD-26062 in sync with H2SU/cubrid CBRD-26062 while this PR remains cross-repo and CircleCI uses pull/6211. Tested: fresh fetch of CUBRID/cubrid heads plus refs/pull/6211/head can checkout 0b3de8d after seeding upstream CBRD-26062. Not-tested: CircleCI rerun before this empty trigger commit Co-authored-by: OmX <omx@oh-my-codex.dev>
|
Reviews (4): Last reviewed commit: "Retry PR checkout after seeding upstream..." | Re-trigger Greptile |
CBRD-26062 diagnostics are intended to be captured from stdout and reused by operators, but the previous JSON-like dump could not be imported by standard JSON tooling. Emit one valid JSON object per SIGUSR1 dump while preserving the same logwr_Gl/la_Info content. Constraint: SIGUSR1 dump must remain lightweight and run outside the async signal handler. Rejected: Post-process JSON-like text after capture | too fragile for field names, pointers, enum values, and string escaping. Confidence: high Scope-risk: moderate Directive: Keep one SIGUSR1 event as one complete JSON document; use NDJSON or a wrapper array only in external collectors for repeated dumps. Tested: .github/workflows/codestyle.sh src/transaction/log_writer.c src/transaction/log_writer.h src/transaction/log_applier.c Tested: git diff --check Tested: cmake --build build_preset_debug --target cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_writer.c.o cs/CMakeFiles/cubridcs.dir/__/src/transaction/log_applier.c.o Tested: bash -ic 'bd' Tested: python3 -m json.tool /tmp/cbrd26062-json-fresh-copy/copy.out Tested: python3 -m json.tool /tmp/cbrd26062-json-fresh-apply/apply.out Not-tested: fully initialized two-node HA runtime dump with populated logwr_Gl/la_Info after strict JSON conversion
|
Reviews (5): Last reviewed commit: "Make SIGUSR1 HA diagnostics importable a..." | Re-trigger Greptile |
|
/run all |
|
✅ TC Branch Finalized for Engine PR was merged. Cleanup Results: TC base branch is ready for the next PR. |
|
✅ TC Branch Finalized for Engine PR was merged. Cleanup Results: TC base branch is ready for the next PR. |
…logwr_Gl (copylogdb) and la_Info (applylogdb) (CUBRID#6211)
…logwr_Gl (copylogdb) and la_Info (applylogdb) (CUBRID#6211)
* [CUBRIDQA-1320] Add TC merge gate workflow to block engine PR merge until TC PRs are merged or closed (#7019) * [CUBRIDQA-1320] Add TC merge gate workflow to block engine PR merge until TC PRs are merged or closed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [CUBRIDQA-1320] Optimize tc-merge-gate workflow - Remove redundant token masking step (create-github-app-token masks automatically) - Add --limit 1 to gh pr list to minimize API response - Wrap comment posting in best-effort block (comment failure no longer affects check result) - Fix heredoc indentation to prevent YAML parse errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update .github/workflows/tc-merge-gate.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update .github/workflows/tc-merge-gate.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * [CBRD-26711] Support avg,sum function on parallel heap scan (#7049) http://jira.cubrid.org/browse/CBRD-26711 Purpose To improve the performance of BUILDVALUE_PROC (single tuple aggregation without GROUP BY) queries in CUBRID's parallel heap scan feature, the supported aggregate functions are expanded. In the existing parallel heap scan implementation, only COUNT(*), COUNT(col), and COUNT(DISTINCT col) were supported for optimization (COUNT_DISTINCT) regarding BUILDVALUE_PROC. Consequently, queries containing aggregate functions such as MIN/MAX/SUM/AVG/STDDEV/VARIANCE were executed serially or processed via MERGEABLE_LIST or XASL_SNAPSHOT methods, leading to unnecessary overhead. To resolve this, the COUNT_DISTINCT optimization is expanded to BUILDVALUE_OPT, introducing a mechanism where each worker thread independently performs partial aggregation and efficiently merges the results in the final stage. Implementation Expand aggregate function support (px_heap_scan_checker.cpp) Add the is_buildvalue_opt_supported_function() helper function to determine supported aggregate functions (COUNT_STAR, COUNT, MIN, MAX, SUM, AVG, STDDEV, STDDEV_POP, STDDEV_SAMP, VARIANCE, VAR_POP, VAR_SAMP). Change the existing condition agg_it->function != PT_COUNT_STAR && agg_it->function != PT_COUNT to !is_buildvalue_opt_supported_function(agg_it->function). Expand worker thread initialization (px_heap_scan_result_handler.cpp - write_initialize) COUNT_STAR: Initialize curr_cnt=0 DISTINCT (All types): Open an independent list per thread Non-DISTINCT (MIN/MAX/SUM/AVG/STDDEV*/VAR*): Initialize curr_cnt=0 Add row-level accumulation logic (px_heap_scan_result_handler.cpp - write) PT_COUNT: curr_cnt++ PT_MIN: If cmpval > 0, copy after domain conversion PT_MAX: If cmpval < 0, copy after domain conversion PT_SUM/PT_AVG: Copy and convert the first row, then accumulate using qdata_add_dbval, curr_cnt++ PT_STDDEV*/PT_VAR*: Convert to double, calculate X^2, accumulate value and value2, curr_cnt++ DISTINCT: Insert into the thread-specific list (same as the existing pattern) Expand merge logic (px_heap_scan_result_handler.cpp - write_finalize) COUNT_STAR: orig.curr_cnt += worker.curr_cnt DISTINCT: Merge lists using qfile_connect_list Non-DISTINCT COUNT: orig.curr_cnt += worker.curr_cnt Non-DISTINCT MIN/MAX/SUM/AVG/STDDEV*/VAR*: Switch to heap 0 using db_change_private_heap(thread_p, 0), call qdata_aggregate_accumulator_to_accumulator(), and then restore the original heap. If accumulator_domain is uninterpreted, copy the worker's interpreted domain. Reallocate main thread values (px_heap_scan_result_handler.cpp - read) After waiting for workers to complete, reallocate the accumulator values of Non-DISTINCT/Non-COUNT aggregations to the main thread's private heap. Copy the value allocated in heap 0 to the private heap using pr_clone_value, switch to heap 0, and free the original value using pr_clear_value. This ensures proper deallocation from the correct heap when pr_clear_value is called in qexec_end_buildvalueblock_iterations. * [CBRD-26678] Support parallel index build (#7011) http://jira.cubrid.org/browse/CBRD-26678 Purpose To add a feature that parallelizes the step of reading and sorting records from a heap file using multiple threads during B+tree index creation (CREATE INDEX / xbtree_load_index). This is implemented by reusing the existing parallel sort (ORDER BY) infrastructure and adding an implementation for an index build-specific type (SORT_INDEX_LEAF). Implementation Heap Sector Partitioning Collect all sectors of the heap file using file_get_all_data_sectors Distribute evenly among threads using ftab_set::split(parallel_num) Each thread scans only its allocated sectors (get_next_vpid) Independent Execution per Thread (sort_listfile_execute, SORT_INDEX_LEAF branch) btree_load_filter_pred_function_info — Independent deserialization of filter/func index predicates per thread bt_load_heap_scancache_start_for_attrinfo — Start heap scancache per thread btree_sort_get_next_parallel — Perform parallel scan by moving pages on a sector basis Result Merging (sort_merge_run_for_parallel_index_leaf_build) Tree-merge the result temporary files of each thread by SORT_PX_MERGE_FILES After all merges are completed, btree_create_file → sort_put_result_from_tmpfile SERVER_MODE / SA_MODE Branching SERVER_MODE: Delegate log_sysop_start, btree_create_file, and heap scancache into sort_listfile SA_MODE: Maintain the existing sequential method Major Changed Files btree_load.h / btree_load.c — Moved and expanded the SORT_ARGS structure, added FILTER_INDEX_INFO, and added parallel scan functions external_sort.c / external_sort.h — Comprehensively added the SORT_INDEX_LEAF branch and added a new parallel merge function file_manager.c / file_manager.h — Added file_get_num_data_sectors * [CBRD-26666] Improve parallel hash join split phase with sector-based page distribution (#6981) Replace `scan_mutex` serialization in the split phase with a lock-free sector-bitmap distribution: workers claim sectors via an atomic counter and walk each 64-page bitmap with `__builtin_ctzll` to compute VPIDs directly, eliminating per-page mutex contention. Adds membuf CAS claim, per-worker `m_current_tfile` tracking for dependent lists, and overflow continuation-page skip. * [CBRD-26743] [CMS] upgrade certificates to 2048 bits base RSA (#7107) upgrade certificates to 2048 bits base RSA * [CBRD-26745] Flush deferred query handlers on net callback error path and cas finalize (#7109) http://jira.cubrid.org/browse/CBRD-26745 fix CAS crash on deferred query_handler free - Ensure `callback_handler::free_deferred_query_handler()` runs on all RPC exit paths via RAII guard - Add fast-path `has_deferred_query_handler()` to skip unnecessary flush - Drain all query handlers at shutdown (`clear_all_query_handlers()` before `ws_final()`) Fixes double-free/use-after-free of `DB_SESSION` leading to `mspace_free` abort. * [CBRD-26718] fix assertion failure in perfmon_add_at_offset() (#7081) http://jira.cubrid.org/browse/CBRD-26718 - prevent assertion in perfmon_add_at_offset() by checking for valid transaction indices. - This addresses a race condition where a transaction ends before its interrupted state is processed. * [CBRD-26698] (change build option) bug-fix: correct length when handling shard keys (#7116) http://jira.cubrid.org/browse/CBRD-26698 (debug build option change) * [CBRD-26754] An error occurs when executing an update statement containing a db_link. (#7127) http://jira.cubrid.org/browse/CBRD-26754 * [CBRD-26109] adjust signal restoration position (#7125) http://jira.cubrid.org/browse/CBRD-26109 * [CBRD-26478] Refactor lock manager initialization (#6930) http://jira.cubrid.org/browse/CBRD-26478 ### Purpose This change refactors `lock_manager` initialization/finalization to centralize runtime configuration, make lock-manager-owned resources explicit, and make partial-initialization cleanup safe. - Initialization defaults and derived sizing logic are now managed in one place. - Resource ownership, initialization state, and cleanup order are clearer. - Finalization now explicitly tracks which lock-manager substructures were initialized before attempting cleanup. - The refactor is not intended to change behavior under default settings. ### Implementation - Consolidated initialization parameters and derived runtime values into an internal lock-manager config (`LK_CONFIG`). - Replaced scattered globals and hardcoded initialization values with config-backed fields (transaction count, transaction local pool sizing, object lock sizing, deadlock detection sizing, verbose mode, dump level). - Added a dedicated initialization-state structure (`LK_INIT_STATE`) to track substructure initialization consistently for the transaction lock table, object lock structures, and deadlock detection resources. - Tracked partial transaction-table initialization using an initialized-entry count so mutex teardown only runs for fully initialized entries. - Merged object lock hash-table and freelist setup into a single initialization path. - Split cleanup into dedicated finalization steps for the transaction lock table, object lock structures, and deadlock detection resources. - Replaced fixed deadlock-related storage with lock-manager-owned dynamic allocations (`TWFG_edge_storage`, `victims`). - Made deadlock detector cleanup safer by nulling the daemon pointer after destroy and guarding `pthread_mutex_destroy()` with explicit initialization state. - Kept the existing public test-facing initialization entry points intact while routing them through the internal config-based initialization path. * [CBRD-26767] Remove unused CI config (.travis.yml) (#7145) http://jira.cubrid.org/browse/CBRD-26767 * [CBRD-26744] Remove unused length out-parameter from db_get_char() and prune dead intl_char_count usages (#7102) http://jira.cubrid.org/browse/CBRD-26744 - Drop dead `length` out-param from db_get_char() and update all callers - Add 8-byte SWAR ASCII fast path in intl_count_utf8_chars/bytes/check_utf8 - Replace intl_nextchar_utf8() with intl_Len_utf8_char[] lookup (same TU) - Skip intl_char_count() when byte_size <= precision in truncate paths - Add CAS payload trailing-NUL defensive asserts (debug only) * [CBRD-26062] Add SIGUSR1-triggered memory dump of logwr_Gl (copylogdb) and la_Info (applylogdb) (#6211) http://jira.cubrid.org/browse/CBRD-26062 * [CBRD-26640] Reuse correlated DBLink result set via CCI cursor rewind (#7103) http://jira.cubrid.org/browse/CBRD-26640 * [CBRD-26643] Replace std::string copy in lowercase_hash with FNV-1a (#7133) http://jira.cubrid.org/browse/CBRD-26643 - Replace lowercase_hash body with a single-pass FNV-1a 64-bit hash to remove the per-call std::string allocation and the separate lowercase transform pass. - Preserve case-insensitive consistency with lowercase_compare via the same tolower fold-in during hashing. - Drop the now-unnecessary direct <string> include. * [CBRD-26739] snapshot cubrid.conf to prevent runtime failures from cubrid.config edits (#7135) http://jira.cubrid.org/browse/CBRD-26739 Currently, the Broker and CAS refer directly to '$CUBRID/conf/cubrid.conf' during runtime. This poses a risk where accidental user edits to the configuration file can cause service failures when a CAS restarts. To isolate the running service from manual configuration changes, this commit implements a snapshot mechanism that clones the configuration at startup. Changes: - Broker Startup: Copies 'cubrid.conf' to '$CUBRID/var/as_pid/.cubrid.conf' and registers the 'CUBRID_CONF_FOR_BROKER' environment variable. - Broker Shutdown: Automatically removes the cloned '.cubrid.conf' file. - Client/CAS Logic: Updated 'boot_restart_client()' to prioritize the snapped config via 'CUBRID_CONF_FOR_BROKER'. Falls back to the original 'cubrid.conf' if the variable is missing or the file is unreadable. * [CBRD-26773] Mark stored_procedure params reloadable to avoid false "not running" (#7159) http://jira.cubrid.org/browse/CBRD-26773 Fix `cubrid pl status` reporting a running `cub_pl` as "not running" when an earlier database in `cubrid.conf` declares `stored_procedure=no` in its `[@<db>]` section. - Add `PRM_RELOADABLE` to the flag bitmask for the parameter in `src/base/system_parameter.c` so the reset-to-default pass picks them up on reload * [CBRD-26705] [Regression][isolation] Phantom read occurs at RepeatableRead isolation level (#7063) http://jira.cubrid.org/browse/CBRD-26705 * [CBRD-26789] fix a wrong null termination of an error message (#7166) fix a wrong null termination of an error message * [CBRD-26772] Remove db_password member from BOOT_CLIENT_CREDENTIAL struct (#7155) http://jira.cubrid.org/browse/CBRD-26772 [refactoring] Remove db_password member from BOOT_CLIENT_CREDENTIAL struct * [CBRD-26771] Fix stack-buffer-overflow in file_create() (#7154) http://jira.cubrid.org/browse/CBRD-26771 * Fix stack-buffer-overflow in file_create() * [CBRD-26768] Fix stack-use-after-scope in do_prepare_select() (#7144) http://jira.cubrid.org/browse/CBRD-26768 * Fix stack-use-after-scope in do_prepare_select() function. * [CBRD-26747] Enable fixed scan for outer heap scans in NLJ by default (#7108) http://jira.cubrid.org/browse/CBRD-26747 Add enable_heap_fixed_scan to enable fixed scan by default for performance; previous logic disabling it for inner index scans is obsolete after pgbuf_ordered_fix. * [CBRD-26739] move _er_log_debug() call after er_init() (#7172) http://jira.cubrid.org/browse/CBRD-26739 - relocated the er_log_debug call to occur after er_init to ensure the error logging system is properly initialized before recording any debug messages. * [CBRD-26291] Recovery for Coordinator (#6820) http://jira.cubrid.org/browse/CBRD-26291 * [CBRD-25862] [CBRD-26401] [CBRD-25471] [CBRD-26708] [CBRD-26676] system catalog update(invisible column, timestamps...) (#6903) http://jira.cubrid.org/browse/CBRD-25862 http://jira.cubrid.org/browse/CBRD-26401 http://jira.cubrid.org/browse/CBRD-25471 http://jira.cubrid.org/browse/CBRD-26708 http://jira.cubrid.org/browse/CBRD-26676 Bundle five system-catalog cleanup tickets into a single PR. - Split db_user / db_password / db_authorization into _db_* base classes with same-named views, and add created_time / updated_time / invalidated_time / expire_time columns (CBRD-25862) - Introduce INVISIBLE / VISIBLE column keywords and surface the flag information through _db_attribute, applying visibility policy to SELECT *, JOIN, and CREATE TABLE AS SELECT (CBRD-26401) - Tighten _db_user.name to varchar(32) (DB_MAX_USER_LENGTH) and propagate the change to dependent owner-name view columns (CBRD-25471) - Activate sql_data_access on _db_stored_procedure and the db_stored_procedure view, and carry the field through the PL/CSQL compile response (CBRD-26708) - Expose the same flag information on the db_attribute view: add is_partition_key, and extend the default_value column domain to express AUTO_INCREMENT (CBRD-26676) * [CBRD-26809] Include <string> in identifier_store.hpp for modern toolchains (#7185) https://jira.cubrid.org/browse/CBRD-26809 * [CBRD-26820] Fix Au_disable leak from parser->au_save overwrite in do_select_internal (#7199) http://jira.cubrid.org/browse/CBRD-26821 - Save/restore the caller's auth-save slot around the inner SELECT helper so it no longer leaks Au_disable into the surrounding UPDATE. * [CBRD-25862] Switch contrib/scripts to _db_user after db_user view split (#7208) http://jira.cubrid.org/browse/CBRD-25862 Following the db_user modification in PR #6903, update contrib/scripts to depend directly on the base table (_db_user) instead of the view. - Switch DBA group membership probe and reserved word conflict checks from db_user view to _db_user table. - Remove `CAST AS VARCHAR(255)` from the owner_name column to align with the narrowed type of _db_user.name (varchar(32)). * [CBRD-26791] log error in CAS log while handling method callbacks (#7167) * log error in CAS log while handling method callbacks - er_stack_push and er_stack_pop in order not to affect the error id with the error logging - log only when not already error logged * [CBRD-26719] Improve hash join probe phase with parallel execution support (#7068) http://jira.cubrid.org/browse/CBRD-26719 Parallelize the single-context hash join probe phase across N workers that share the primary's read-only hash table and split probe-side pages via sector-based atomic claim, with per-worker outputs merged serially into the primary. * [CBRD-25863] Implement Information Schema (#7174) http://jira.cubrid.org/browse/CBRD-25863 http://jira.cubrid.org/browse/CBRD-26631 http://jira.cubrid.org/browse/CBRD-26612 Introduce the SQL:2003 INFORMATION_SCHEMA into CUBRID as 19 static views, each applying row-level filtering based on the caller's privilege visibility, together with the helper SQL functions and privilege-model changes needed to populate the standard columns. - CBRD-25863 — INFORMATION_SCHEMA: - A dedicated INFORMATION_SCHEMA system user owns every view; it cannot log in, be dropped, or have its privileges altered. - Hybrid definer/invoker privilege model: system catalogs are DBA-owned and grant SELECT only to INFORMATION_SCHEMA; each view is owned by INFORMATION_SCHEMA and grants SELECT to PUBLIC. - Install runs as an independent step after system catalog installation. - View names have a single source of truth that other modules consult. - Column order is aligned with PostgreSQL information_schema for tool compatibility. - Privilege gating uses a two-tier macro family (atomic conditions composed into per-view-type gates). - CBRD-26631 — COLLECTION_TO_STRING: unary SQL function serializing a SET/MULTISET/SEQUENCE to VARCHAR, used by partitions.partition_description. - CBRD-26612 — estimated_* statistics functions (estimated_table_rows, estimated_avg_row_length, estimated_data_length, estimated_data_free) that populate the standard table/partition statistics columns. * [CBRD-26510] [Regression] Core dumped in cubthread::worker_pool<cubthread::entry>::stop_execution at src/thread/thread_worker_pool.hpp:688 (#7191) http://jira.cubrid.org/browse/CBRD-26510 When the heap_insert_logical() function executes and fails to insert a record into a specific slot on a page for certain reasons, it acquires a write latch but fails to release it. Subsequently, when the page is flushed (due to checkpoint or server stop), the thread performing the flush determines that another thread is holding the write latch and requests an async flush. This causes the thread to enter an infinite wait state. To prevent this infinite wait, the following solution is applied: After goto error handling in the heap_insert_logical() function, call heap_unfix_watchers(thread_p, context) to release the occupied latch. * [CBRD-26799] Fix row loss in parallel index build dual-cursor desync (#7176) http://jira.cubrid.org/browse/CBRD-26799 Overview btree_sort_get_next_parallel (added in parallel index build path from CBRD-26678 / PR #7011) maintains two scan cursors: Slot cursor sort_args->cur_oid — advanced by heap_next_1page Page cursor sort_args->curr_sec / curr_pgoffset — advanced by get_next_vpid When SORT_REC_DOESNT_FIT (nofit) occurs, bt_load_put_buf_to_record rewinds cur_oid to prev_oid at the function entry point. However, if a heap page transition occurred within the same invocation, the slot cursor rewinds to the previous page while the page cursor already points to the next page. In the following invocation, the unconditional (*offset)++ in get_next_vpid skips the next page entirely, causing approximately one heap page worth of rows to be missing from the built B-tree. As a result, CREATE INDEX executed via the parallel path intermittently (approximately 6/100 times) creates an index missing approximately 180–250 entries. A regular count(*) heap scan is normal, and the loss is only revealed through index scans (e.g., INDEX_SS). The serial path btree_sort_get_next is unaffected because it has only one cursor. Implementation Snapshot cur_oid to a local variable slot_resume_oid immediately before each heap_next_1page call. At the nofit label, realign cur_oid to the page of vpid (using slot_resume_oid, or slot 0 of vpid if null). This prevents the slot cursor and page cursor from becoming misaligned. Only src/storage/btree_load.c was modified; the serial path remains unchanged. Testing Release build, reproduction script failure.sql: 562/562 runs successful (approximately 6/100 failures before the fix) In all executions, select count(*) from t (heap scan) was normal — before the fix, the heap was intact; only the built index was deficient * [CBRD-26722] Expand parallel heap scan to parallel scan (index, heap, list) (#7062) http://jira.cubrid.org/browse/CBRD-26722 Purpose We will extend parallel scanning (parallel_heap_scan), which was previously applied only to heap scans, to list scans and index scans, and generalize it to enable parallel processing for all three scan types used in the query executor (S_HEAP_SCAN, S_LIST_SCAN, S_INDX_SCAN). We will restructure the parallel_heap_scan namespace in src/query/parallel/px_heap_scan/ as parallel_scan in src/query/parallel/px_scan/, and add list/index input partitioners and slot iterators on top of the manager<RESULT_TYPE, SCAN_TYPE> template. Result collection (result_handler), worker management, interrupt, and trace are reused as common code regardless of the scan type. The goal is to achieve performance gains through parallelization in large-scale scans (not only heap, but also intermediate result lists and index ranges). Implementation Please refer to the review document. * Update tc-merge-gate.yml for remove feature branch in target scope. * [CBRD-26202] Add Optimizer Histogram Support (#7180) http://jira.cubrid.org/browse/CBRD-26202 - Purpose Add histogram statistics support for optimizer selectivity estimation in CBRD-26202. This change introduces histogram creation/query/client modules, adds SQL syntax for histogram create/drop/query, and adds related system catalog/view objects. It also integrates histogram statistics into optimizer selectivity estimation for equality predicates, range predicates, and LIKE predicates. The work touches parser, lexer, semantic checks, name resolution, catalog, execution path, sampling scan, and optimizer paths. Histograms can be created/dropped according to schema rules, and the optimizer uses them to improve cardinality estimation quality. - Implementation Implemented end-to-end histogram support across syntax, metadata, execution, and optimization paths Please refer to the review document for detailed design decisions and code-level breakdown. * [CBRD-26833] fix PRINT_OWNER_NAME macro (#7211) http://jira.cubrid.org/browse/CBRD-26833 * fix PRINT_OWNER_NAME macro * [CBRD-26800] refactoring boot_cl (#7178) <http://jira.cubrid.org/browse/CBRD-26800> * [Refactoring boot_cl.c for better readability and maintainability * [CBRD-26761] Reduce sampling scan I/O by pre-picking pages via ftab metadata (#7136) http://jira.cubrid.org/browse/CBRD-26761 Purpose Reduces the number of page fix operations in the sampling scan path (SELECT /*+ SAMPLING_SCAN */ ... and the UPDATE STATISTICS code path) from "every page" down to "sampled pages only". Previously all pages in the heap were fixed and loaded into the buffer pool, then rows were sampled at fixed intervals. The problem is that intermediate pages were fixed merely to follow the next page VPID (HEAP_CHAIN.next_vpid), even though they were never used for sampling. The more pages a table has, the more page fixes grow in proportion to the page count. By reusing the ftab (file-allocation bitmap) metadata that parallel heap scan already maintains, sample VPIDs can be pre-picked without fixing any page. So we first pick the VPIDs of the pages to sample and then fix only those pages. Partitioned tables are not sampled per partition; instead, after pruning, all partitions are gathered and the sample is taken table-wide in one pass, then split into per-partition slices. A small table that does not reach the sampling floor is simply scanned in full. Implementation Move the ftab module into storage (px_ftab_set.hpp → src/storage/ftab_set.{hpp,cpp}) ftab is a storage-layer data structure, so it was moved out so it can be used outside query/parallel, and the namespace was cleaned up. The include/type references at the call sites were updated as well, and no alias was left behind. Add collect_strided_vpids_multi (ftab_set.cpp) Merges the ftab bitmaps of several HFIDs (the pruned partitions, or a single root HFID when non-partitioned) and walks them once to pick sample VPIDs. It only looks at metadata, with no page fix. The sampling interval (weight) is decided by a bucketed formula over the accurate user-page total obtained from file_get_num_user_pages: weight = max(min(3, ceil(total/MIN)), max(total/MAX, 1)) (MIN_HEAP_SAMPLING_PAGES=5000, MAX_HEAP_SAMPLING_PAGES=10000). That is, roughly 1/3 (33%) sampling, weight=1 (full scan) below the floor, and the sample count capped near MAX above the ceiling. The gaps are not a uniform stride but are scattered with a Poisson distribution (mean = weight) to reduce clustering bias. The seed is fixed, so the same input yields the same sample (deterministic, reproducible). The heap header page (hfid->hpgid) is excluded from the pick — a sampled page must not read slot 0 (HEAP_HDR_STATS) as a data record. Partition boundaries are emitted together as a prefix sum (part_offsets) so the result can be split into per-partition slices. Wire sampling scan into the flow (query_executor.c, scan_manager.c, heap_file.{c,h}) sampling_info holds picked_vpids / picked_count / picked_cursor / part_offsets / slice_end / n_parts / partition_cursor / weight / prepared. qexec_prepare_table_sampling gathers the pruned HFIDs and picks the sample once (the prepared flag prevents re-picking on reopen / cached re-execution). qexec_init_next_partition sets the cursor to the corresponding slice (part_offsets[pc] .. part_offsets[pc+1]) on each partition switch. heap_next_sampling pulls pages one by one from the picked array by cursor instead of chain traversal. The chain-traversal helper heap_vpid_skip_next lost its callers, so its definition and extern were both removed. The pick arrays (picked_vpids / part_offsets) persist across partition switches, and scan_free_sampling frees them once via qexec_clear_access_spec_list (XASL teardown) and the open-error path. * [CBRD-26804] Raise pgbuf tracker max re-fix from 16 to 400 (#7222) http://jira.cubrid.org/browse/CBRD-26804 Raised the limit from 16 to 400 to align with the default value of max_recursion_sql_depth. No resource-related side effects (re-fixing the same page only pins the same frame multiple times). * [CBRD-26713] Resolve DMRB corruption by fixing race condition during context migration. (#7205) Resolve DMRB corruption by fixing race condition during context migration. * [CBRD-26764] Remove the controller entry point to prevent permission issues. (#7189) * Remove the controller entry point to prevent permission issues. * Exclude the members from compilation * Exclude the header file * [CBRD-26840] Suppress FORCE_FIXED_SCAN when scan pipeline acquires row locks (#7227) http://jira.cubrid.org/browse/CBRD-26840 If any scan in the pipeline requires a lock (i.e., ACCESS_SPEC_FLAG_FOR_UPDATE or force_select_lock), we disable FORCE_FIXED_SCAN only in that case. * [CBRD-26859] Qualify information_schema-owned class names with owner in CAS schema info (#7234) http://jira.cubrid.org/browse/CBRD-26859 - CAS schema-info APIs now expose information_schema-owned classes as information_schema.<class_name> instead of the bare class name. - Previously only user (non-system) classes were owner-qualified, so information_schema classes — classified as system classes — were returned unqualified; this corrects that. - Consolidated the duplicated owner-qualification logic across the schema-info query paths into a single shared definition. * [CBRD-26006] Scale Range Expansion and Floating-Point NUMERIC Type Support (#6486) http://jira.cubrid.org/browse/CBRD-26006 Expand the scale range, introduce variable-length storage, add a Floating-Point NUMERIC type, and optimize performance to improve the range and precision of the existing NUMERIC type. Key changes * Expand the supported precision/scale range and adopt Oracle-style precision/scale interpretation * Fixed Numeric: precision 1–38, scale -84 to 127 * Floating-Point NUMERIC: precision 1–40, scale -214 to 252 * Change Fixed Numeric storage from a fixed 16-byte format to a precision-based variable-length format (bytes = ceil(precision / log10(256))) * Add a Floating-Point NUMERIC type * Interpreted as Floating-Point NUMERIC when the domain precision is DB_DEFAULT_NUMERIC_PRECISION (40) * Uses precision and scale stored in the data header rather than the domain * Stored as a 3-byte header plus variable-length payload * Behaves as Floating-Point NUMERIC when NUMERIC is unspecified * Arithmetic * Add DB_TYPE_NUMERIC-specific fp_numeric_db_value_(add|sub|mul|div), supporting arithmetic beyond 38 digits and rounding results that exceed the target precision * Keep legacy numeric_db_value_* for SERIAL/SHORT/INTEGER/BIGINT only * Add hybrid normalization for Hash Join (Fixed↔Floating-Point combinations resolve to Floating-Point NUMERIC) * Performance optimization * Sign handling: two's complement → managed via a domain flag; data is always stored as an absolute value * Arithmetic redesigned from byte-wise processing to uint64_t-based word operations * Knuth division / Horner's method / 10^16 chunking and LUT for type casts / bigint fast path * Fix a bug where invalid-format string literals could be silently converted to incorrect values during NUMERIC coercion (added validation for duplicate decimal points, digit presence, and characters following trailing spaces) Related issues * [CBRD-26243] (Phase-1) Scale Range Expansion (1/2) (#6385) * [CBRD-26317] (Phase-1) Arithmetic Operations and Built-in Functions for Extended Scale Range (2/2) (#6520) * [CBRD-26367] (Phase-2) NUMERIC Storage Format Optimization (#6623) * [CBRD-26397] (Phase-3) Floating-Point NUMERIC Type Support (#6671) * [CBRD-26575] (Phase-4) NUMERIC Performance Optimization (#6881) * [CBRD-26749] Strengthen NUMERIC Parsing Rules Compatibility (Breaking Changes) * Fixed Numeric and Floating-Point NUMERIC storage formats are not backward compatible (migrate lower-version Fixed Numeric and SERIAL values via unload/load) * Removed parameters: * compat_numeric_division_scale * stored_procedure_return_numeric_size * The default value of oracle_compat_number_behavior (yes/no) will be determined separately before the Guava release * [CBRD-26827] Fix SIGSEGV in pt_print_dblink_table when server name is quoted (#7203) http://jira.cubrid.org/browse/CBRD-26827 * [CBRD-26812] Handle resource allocation failure during connection pool initialization. (#7194) * Add guards to handle resource allocation failure. * [CBRD-26838] Remove repetitive re-allocation for char * in a same scope (#7206) http://jira.cubrid.org/browse/CBRD-26838 Purpose This pull request aims for micro optimization when repetitive strlen/strcat/strcpy call happens. Implementation O(N^2) strlen => O(N) strlen, temporary variable strcpy->strcat->strcat => strcpy->snprinf or snprintf, temporary len variable extraneous malloc => strdup * [CBRD-25863] Correct Information Schema Specs (#7241) http://jira.cubrid.org/browse/CBRD-25863 - Widen the default-expression columns (COLUMNS.column_default, PARAMETERS.parameter_default, DOMAINS.domain_default) from 255 to 2048 to match the underlying catalog columns widened by CBRD-26676, preventing truncated values. - Change COLUMNS.is_generated from the non-standard 'NO' to the SQL-standard 'NEVER', and widen the column so the standard value set ('NEVER'/'ALWAYS') fits without truncation. - DOMAINS.domain_default is widened for spec consistency only; the view always emits NULL for it. * [CBRD-26610] Extend broker_log_top features with broker.conf collection and split output by broker (#7242) http://jira.cubrid.org/browse/CBRD-26610 - Add '--from-conf' option to parse and collect log files from $CUBRID/conf/cubrid_broker.conf. - Add '-S / --split' option to generate results per broker into separate hierarchical directories (broker_log_top_YYMMDD_HHMM/broker_name/). * [CBRD-26845] To disable type checking for NA fields in queries generated by unloaddb (#7220) http://jira.cubrid.org/browse/CBRD-26845 * [CBRD-23839] Fix race condition in unloaddb.sh schema unload (#7243) http://jira.cubrid.org/browse/CBRD-23839 [CBRD-23839] Fix race: wait for the backgrounded schema unload do_unloaddb() ran the schema unload in the background ('&') but never waited on it. The final 'wait' only tracks the per-slot worker subshells, and each waited only on its data-unload PID, so the schema unload was orphaned and the schema files could still be incomplete when "Completed." was printed (an intermittent failure under load). Capture the schema unload PID and wait on it before the worker returns (on both the schema-only and the schema+data paths), so the schema files are complete before "Completed.". The schema unload still runs concurrently with the data unloads, preserving the parallel design. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> * [CBRD-26839] Emit zero-stats parallel heap scan trace when no worker stats collected (#7219) http://jira.cubrid.org/browse/CBRD-26839 Problem: In the trace output of a parallel heap scan, when no statistics have been collected at all, the sentinel value (numeric_limits<UINT64>::max()) was being exposed as-is. When zero rows are returned (e.g., via LIMIT 0), accumulative_trace_storage::m_stats is empty, so the min-reduction loop never executes, and the initial value was printed verbatim as 18446744073709551615..0. --- Change: Added an m_stats.empty() early-return guard to the two dump functions — dump_stats_text and dump_stats_json — in src/query/parallel/px_heap_scan/px_heap_scan_trace_handler.cpp. When empty, the loop is skipped and all statistics are output as 0. --- Repro / verification: ;trace on SELECT COUNT(*) AS cnt FROM (SELECT id FROM t_px_sort ORDER BY id LIMIT 0) sub; Result: SCAN (table: dba.t_px_sort), (heap time: 0, fetch: 0, ioread: 0, readrows: 0, rows: 0) (parallel workers: 0, heap time: 0..0, readrows: 0..0, rows: 0..0, gather: mergeable list) Matches the expected output in JIRA. * [CBRD-26599] Implement Join Predicate Push-down via Transitive Closure (#6917) http://jira.cubrid.org/browse/CBRD-26599 Add implied join terms derived from the transitive closure of equi-join predicates so the optimizer can explore join orders that were previously unreachable for lack of a direct join edge. * http://jira.cubrid.org/browse/CBRD-26851 * [CBRD-26612] Resolve estimated_*/INDEX_CARDINALITY class name by current schema (#7251) http://jira.cubrid.org/browse/CBRD-26612 - Allow the estimated_table_rows / estimated_avg_row_length / estimated_data_length / estimated_data_free functions and INDEX_CARDINALITY to accept a bare table name (without owner) and resolve it against the current schema. - Previously these matched the server's exact unique_name (owner.name), so a call such as estimated_table_rows('t1') failed the lookup and returned NULL; bare names now work as expected. - Qualify constant string-literal class-name arguments with the current schema name during type checking, following the same rules as ordinary table references. Arguments already in owner.name form, system class names, and the unique_name column values passed by INFORMATION_SCHEMA views are left unchanged. Server-side evaluation logic is unchanged; only client-side name qualification is added. * [CBRD-26888] Fix debug assert crash in midxkey prefix compression (#7264) http://jira.cubrid.org/browse/CBRD-26888 In midxkey prefix compression, even when the postfix offset is valid, if the merged key (postfix offset + prefix) exceeds 255 bytes, a legitimate break path was missing from the assert condition, causing cub_server to dump core only in debug builds. Add the missing condition (offset + prefix_size) >= OR_MULTI_MAX_OFFSET to the assert. This only supplements the debug assert with no behavioral change. - Not a regression: present since midxkey compression was introduced (CBRD-24988, 2023); unrelated to char-vlen. - Repro: long_checkpoint_dml_ddl.sh (RQG); intermittent, key-length dependent. * Update config.yml for show all file list from extract CUBRID artifact. * [CBRD-26663] CHAR/VARCHAR unified variable-length storage (feature → develop) (#7164) https://jira.cubrid.org/browse/CBRD-26663 Convert CHAR storage from fixed-length to variable-length and unify the CHAR/VARCHAR header to remove the O(N) character-scan overhead on the CHAR(N) UTF-8 readval path. Background: CHAR(N) UTF-8 allocates a fixed precision*4 bytes on disk and fills the remaining space with 0x20. Because both the trailing pad and the unused space are 0x20 and no byte-length information is stored on disk, every readval had to walk the value character by character via intl_char_size -> intl_nextchar_utf8 (O(N)) to compute the valid byte length. Profiling showed this path accounted for about 49% of total CPU, roughly 90x more expensive than the actual value comparison (0.55%). VARCHAR has the same structural issue, requiring an O(N) intl_char_count scan for character-based operations such as LENGTH() and SUBSTRING(). Changes (3 steps): Step 1 (CBRD-26706): Move CHAR from fixed-length to variable-length storage - Convert CHAR storage from fixed length (precision*4 byte) to a variable layout - Introduce a 12-byte LARGE header (length / size / compressed_size) - Look up the byte size in O(1) from the header's size field on readval, eliminating the intl_char_size call - Remove the trailing (domain) pad; keep the char pad used for trailing-space comparison - Set tp_Char.variable_p = 1 to share the same variable-attribute flow as VARCHAR - Allow CHAR midxkey elements in pr_midxkey_element_disk_size Step 2 (CBRD-26762): Unify CHAR/VARCHAR headers and enable CHAR compression - Merge the CHAR/VARCHAR hot-path functions into mr_*_char_type_common (remove duplication) - Add length (char_count) to the unified string header for O(1) character-based operations - Enable CHAR compression (LZ4) on the same compression path as VARCHAR - Add or_put/get_string_header helpers - Fix regressions caused by the previous VARCHAR-only assumptions (CHAR double-free, CONNECT BY misbehavior, loaddb crash, missing result-set compression check, etc.) Step 3 (CBRD-26763): Introduce variable headers (Tiny/Small/Medium/LARGE) - Resolve the header overhead of short strings caused by the single 12-byte LARGE header - Use 4 header types (1/4/6/12 bytes) depending on size; empty string goes from 16 to 4 bytes - Add or_string_pick_header_type / or_mem_string_pick_header_type dispatch helpers - Change or_varchar_length / or_packed_varchar_length signatures to (length, size, csize) Effect: Removes the intl_char_size / intl_nextchar_utf8 overhead on the CHAR(N) UTF-8 readval path, enables O(1) access for character-based operations such as LENGTH()/SUBSTRING(), and improves storage efficiency for short strings. Compatibility: CHAR comparison, network transfer, and query results are unchanged, and backward compatibility with existing data is preserved. Verification: All existing CHAR-related SQL tests (comparison, string functions, sorting, index scan) pass, correctness was verified on multibyte (Korean/emoji) CHAR columns, and profiling shows a reduced share of intl functions. * [CBRD-26887] Fix NULL variable-length NUMERIC over-read crash in unloaddb (#7263) http://jira.cubrid.org/browse/CBRD-26887 After FP NUMERIC made numeric variable-length, NULL numerics are stored as zero-length slots. mr_data_readval_numeric did not handle size == 0, so unloaddb misread garbage as the numeric body, shifting the following CHAR read and overrunning the record buffer (assert in or_advance during get_desc_current -> data_readval_string). varchar already treated size == 0 as NULL; numeric did not. Restore symmetry by adding size == 0 to the NULL branch (or_advance(buf, 0)). - precision == 0 branch kept for backward compat (numeric(0,0) -> NULL). - Use or_advance(buf, 0), not db_value_domain_init(): init treats precision 0 as invalid (ER_INVALID_PRECISION, overwrites to 38/15). Caller pre-inits with db_make_null, so or_advance(buf, 0) is a NULL-preserving no-op. - DB_TYPE_NUMERIC check needed: VARIABLE also has precision 0. Surfaced by moving CHAR into the variable section (NULL numeric + variable CHAR). Verification: 32x unload no crash, round-trip 200/200, minimal repro passes. * [CBRD-26893] Fix uninitialized class pointer dereference in IS NOT NULL predicate folding (#7265) http://jira.cubrid.org/browse/CBRD-26893 - Fix a crash (SIGSEGV) when folding an IS NOT NULL predicate on a class whose metadata cannot be fetched: the optimization now gives up safely instead of dereferencing an uninitialized class object. * [CBRD-26755] Reduce poll() overhead in css_readn and css_vector_send via optimistic I/O fast-path (#7215) http://jira.cubrid.org/browse/CBRD-26755 Try recv/writev first and call poll() only when the socket is not ready, avoiding an unnecessary syscall on the hot path. * [CBRD-26864] Prevent owner change when renaming a table via ALTER TABLE by adding the missing owner-change check (#7250) http://jira.cubrid.org/browse/CBRD-26864 Add the owner-qualifier check to `do_alter_clause_rename_entity()` that the **RENAME TABLE** path already had, raising `ER_SM_RENAME_CANT_ALTER_OWNER` when the old and new owners differ. * [CBRD-26870] Set DBLink remote column collation to match its codeset (#7253) http://jira.cubrid.org/browse/CBRD-26870 DBLink remote columns filled codeset from CCI metadata but left collation_id at its default 0 (LANG_COLL_ISO_BINARY), since CCI exposes a column's charset but not its collation. A remote UTF8 column then kept an ISO88591 collation, breaking the pt_check_expr_collation() invariant that an equal collation_id implies an equal codeset (debug: assertion failure; release: silent wrong results). Assign the codeset's binary collation in pt_dblink_table_fill_attr_def() so collation_id and codeset stay consistent. * [CBRD-26906] USE INDEX hint ignored — optimizer picks sequential scan over the hinted index (#7273) http://jira.cubrid.org/browse/CBRD-26906 Ensure USE INDEX hint is honored by excluding sequential scan from consideration, preventing cost-based selection of seq scan over the hinted index. * [CBRD-26863] Fix parallel index scan overflow-chain deadlock vs concurrent DML/DDL (#7239) http://jira.cubrid.org/browse/CBRD-26863 **Purpose** This change fixes a deadlock-induced hang that can occur during parallel index scans when DML/DDL operations (such as DELETE page splits, DROP deallocation, vacuum, etc.) are executed concurrently on the same index. The root cause is that the overflow chain pool invokes `pgbuf_fix()` while holding `m_overflow_mutex` (a C++ `std::mutex`). The normal lock acquisition order is **leaf latch → overflow latch**. However, refixing a leaf page while inside the mutex reverses the order. Since this mutex is not represented in the pgbuf deadlock detection graph, the resulting deadlock cannot be detected or resolved automatically and becomes a permanent hang. **Implementation** ### Key-publish approach The producer now deep-copies the key into `overflow_slot` while holding the leaf S-latch. Helpers only duplicate the key from the slot and no longer refix the leaf page. The previous helper path involving `spage_get_record()` and `btree_read_record()` has been removed, eliminating the possibility of leaf-page fixes while holding `m_overflow_mutex`. The `overflow_slot` structure has been updated by removing `leaf_vpid` and `leaf_slot_id`, and adding the key (`DB_VALUE`) together with a `clear_key` flag. ### Moving page fixes outside the mutex `claim_next()` now snapshots only the cursor state while holding the mutex. After releasing the mutex, it fixes the overflow page using `PGBUF_UNCONDITIONAL_LATCH`. Both writers and vacuum workers acquire latches in the normal **leaf → overflow (top-down)** order, so performing the page fix outside the mutex does not introduce lock cycles. In addition, parallel scans do not use latch coupling, so a conditional latch is unnecessary. ### Concurrency-related improvements * Introduced `close_slot_locked()` to centralize slot cleanup (key release, field reset, and notification), preventing key lifetime leaks and double-free issues. * Added a per-slot `claim_in_flight` flag to prevent multiple helpers from processing the same overflow page concurrently. * Cursor advancement now occurs exactly once after a successful page fix. * It is valid for another producer to publish work after `signal_no_more_leaves()` has been issued. Therefore, the assertion in `try_publish()` has been relaxed to check `m_active_workers > 0`. The changes are limited to `src/query/parallel/px_scan` and do not modify the core B-tree concurrency protocol. **Remarks** * Verified that debug builds produce no warnings. * Confirmed that there are no remaining `pgbuf_fix()` calls while holding either `m_overflow_mutex` or `m_leaf_mutex`. * Verified parallel/serial consistency: * Overflow duplicate-key scenarios produce identical results. * `COUNT` results (2000) and `GROUP BY` results (400 × 5) match between parallel and serial execution. * Due to environment limitations, the following validations were not performed: * Long-running stress tests under real concurrent workloads to verify the absence of hangs or core dumps. * Memory leak verification using ASAN or Valgrind. * [CBRD-26805] Fix the HY010 Error During DBLink Operation (#7257) Fixes intermittent errors that occurred in the CAS/CGW (ODBC) path when executing DML operations (such as INSERT) on a remote MySQL database through DBLink. Symptom 1: SQLRowCount() returns -1, and the client displays the error message "Number of rows affected is unknown". Symptom 2: [HY010] Function sequence error occurs. * [CBRD-26838] Replace malloc+strcpy with strdup where safe (#7254) * [CBRD-26838] Replace malloc+strcpy with strdup where safe * lint: remove dead if condition * [CBRD-26889] Lower ISCAN_OID_ACCESS_OVERHEAD from 20 to 5 to favor index scan http://jira.cubrid.org/browse/CBRD-26889 Lower the per-OID heap access CPU penalty constant (ISCAN_OID_ACCESS_OVERHEAD) for non-covering index scans from 20 to 5 to favor index scans. * [CBRD-26880] Fix DBLink remote bind for FLOAT, DATETIME, and typed NULL values (#7255) http://jira.cubrid.org/browse/CBRD-26880 Fix three type-handling bugs in dblink_bind_param (src/query/dblink_scan.c) that corrupted host-variable (?) binding to remote servers: FLOAT was bound through the DOUBLE path (4-byte value read as 8-byte → ≈0), DATETIME passed month/day/year to db_datetime_decode in the wrong order, and a typed NULL (domain type + null flag) fell into its domain branch instead of binding as NULL. Bind FLOAT via CCI_U_TYPE_FLOAT, fix the DATETIME_DECODE argument order, and route any null dbval to the DB_TYPE_NULL branch. * [CBRD-26841] issue length limit auto generated name for long table name (#7230) http://jira.cubrid.org/browse/CBRD-26841 * [CBRD-26841] Issues with length limits on automatically generated names for long table names * Restrict the length of auto-increment serial names to avoid excessive length * An error is handled if the serial name automatically generated by the AUTO_INCREMENT attribute exceeds the serial name length limit. * An error is handled if the internal table name automatically generated by the table's partition attribute exceeds the table name length limit. * [CBRD-26894] Fix core dump in er_message::set_error during histogram stat collection (#7270) http://jira.cubrid.org/browse/CBRD-26894 [CBRD-26894] Fix wrong er_set (ER_FAILED) in obj_find_multi_attr Regression of CBRD-26202. obj_find_multi_attr() called er_set(..., ER_FAILED, 0) on BTREE_ERROR_OCCURRED. ER_FAILED is not a settable error id, so it trips the assert in cuberr::er_message::set_error() and cores the client during histogram stat collection. * [CBRD-26825] View query execution error including CONNECT BY query (#7209) http://jira.cubrid.org/browse/CBRD-26825 --------- Co-authored-by: tw-kang <twkang3219@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Ilhan <70995854+xmilex-git@users.noreply.github.com> Co-authored-by: Joo Youngjin <68979537+youngjinj@users.noreply.github.com> Co-authored-by: Kisoo Han <kisoo-han@cubrid.com> Co-authored-by: Hyung-Gyu Ryoo <hgryoo@cubrid.com> Co-authored-by: Mike MyungHwan Oh <mhoh@cubrid.com> Co-authored-by: Byungwook Kim <bwkim@cubrid.com> Co-authored-by: KIM HUISU <heexoo@cubrid.com> Co-authored-by: Kwang Soo Chae <kchae@cubrid.com> Co-authored-by: kangmin <kangmin5505@gmail.com> Co-authored-by: Na, Hyunik <67700070+hyunikn@users.noreply.github.com> Co-authored-by: ctshim <78332782+ctshim@users.noreply.github.com> Co-authored-by: SE park <shpark@cubrid.com> Co-authored-by: Daehyun Kim <dhkim@cubrid.com> Co-authored-by: CUBRID <cubridci@users.noreply.github.com> Co-authored-by: 정소희 <94791489+sohee-dgist@users.noreply.github.com> Co-authored-by: jongmin-won <55681111+jongmin-won@users.noreply.github.com> Co-authored-by: 이윤진(Lee Yunjin) <168180007+gg582@users.noreply.github.com> Co-authored-by: Hyunuk Lee <41990473+HyunukLee@users.noreply.github.com> Co-authored-by: airnet73 <61675061+airnet73@users.noreply.github.com>
http://jira.cubrid.org/browse/CBRD-26062
Purpose
복제 진행 사항에 대해 db_ha_apply_info 카탈로그나 applyinfo 유틸리티를 이용해 확인할 수 있으나
이 정보는 copylogdb나 applylogdb의 실시간 정보가 아니다.
두 프로세스가 운영 환경에서 비정상 동작을 할 때 각 프로세스 내부에서 어떤 LSA를 처리 중인지,
로그 메타 정보는 무엇인지 확인하여 보다 효과적으로 원인 파악을 수행하기 위한 코드이다.
특히, copylogdb의 logwr_Gl, applylogdb의 la_Info 전역변수의 정보를 통해 행이 걸린 원인,
복제 지연 사유 등을 보다 정확하게 진단할 수 있을 것이라고 판단된다.
Implementation
copylogdb, applylogdb가 SIGUSR1 시그널 받을 시 메모리 정보 출력
Remarks
함수 별로 커밋을 나눠놓았습니다.
Files changed로 전체 코드를 한 눈에 보기 힘드시기 때문에
Commit 별로 코드를 보시면 리뷰하시는데 도움이 되실 것 같습니다.