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-20156] introduce light weight rwlock #9

Merged
merged 7 commits into from Apr 12, 2016
Merged

Conversation

eseokoh
Copy link
Contributor

@eseokoh eseokoh commented Apr 4, 2016

  • introduce RWLOCK and its monitoring stub
  • rename CSS_CRITICAL_SECTION as CRITICAL_SECTION

hongwoo-nam pushed a commit that referenced this pull request Apr 7, 2016
- fixed, _op_get_db_user_id function doesn't work and it also causes
core dump like following when debug mode:

```
$ cub_manager: ../../src/compat/db_macro.c:2604: db_get_int: Assertion
`value->domain.general_info.type == DB_TYPE_INTEGER' failed.

#0 0x00000038c8e328a5 in raise () from /lib64/libc.so.6
#1 0x00000038c8e34085 in abort () from /lib64/libc.so.6
#2 0x00000038c8e2ba1e in __assert_fail_base () from /lib64/libc.so.6
#3 0x00000038c8e2bae0 in __assert_fail () from /lib64/libc.so.6
#4 0x00007f27abf567f6 in db_get_int (value=0x7f27977e9830) at
../../src/compat/db_macro.c:2604
#5 0x00007f27ad900737 in _op_get_db_user_id (res=0x7f277c00caa0,
user=0x99bae0) at ../../src/cm_common/cm_dep_tasks.c:2830
#6 0x00007f27ad8fd4c5 in cm_ts_userinfo (in=0x7f277c01dcb0,
out=0x7f277c00caa0, _dbmt_error=0x7f27977e9960 "?") at
../../src/cm_common/cm_dep_tasks.c:1368
#7 0x000000000043aadb in ts_userinfo (req=0x7f277c01dcb0,
res=0x7f277c00caa0, _dbmt_error=0x7f27977e9960 "?")
    at ../../../../cubridmanager/server/src/cm_job_task.cpp:743
#8 0x0000000000474ede in ch_process_request (req=0x7f277c01dcb0,
res=0x7f277c00caa0) at
../../../../cubridmanager/server/src/cm_server_interface.cpp:296
#9 0x0000000000475006 in cm_async_request_handler
(lpArg=0x7f279002e720) at
../../../../cubridmanager/server/src/cm_server_interface.cpp:483
#10 0x00000038c9607851 in start_thread () from /lib64/libpthread.so.0
#11 0x00000038c8ee767d in clone () from /lib64/libc.so.6
```
@eseokoh eseokoh merged commit ff0db3a into CUBRID:develop Apr 12, 2016
@eseokoh eseokoh deleted the rwlock branch April 12, 2016 06:10
andrei14vl pushed a commit to andrei14vl/cubrid that referenced this pull request Apr 18, 2016
- fixed, _op_get_db_user_id function doesn't work and it also causes
core dump like following when debug mode:

```
$ cub_manager: ../../src/compat/db_macro.c:2604: db_get_int: Assertion
`value->domain.general_info.type == DB_TYPE_INTEGER' failed.

#0 0x00000038c8e328a5 in raise () from /lib64/libc.so.6
CUBRID#1 0x00000038c8e34085 in abort () from /lib64/libc.so.6
CUBRID#2 0x00000038c8e2ba1e in __assert_fail_base () from /lib64/libc.so.6
CUBRID#3 0x00000038c8e2bae0 in __assert_fail () from /lib64/libc.so.6
CUBRID#4 0x00007f27abf567f6 in db_get_int (value=0x7f27977e9830) at
../../src/compat/db_macro.c:2604
CUBRID#5 0x00007f27ad900737 in _op_get_db_user_id (res=0x7f277c00caa0,
user=0x99bae0) at ../../src/cm_common/cm_dep_tasks.c:2830
CUBRID#6 0x00007f27ad8fd4c5 in cm_ts_userinfo (in=0x7f277c01dcb0,
out=0x7f277c00caa0, _dbmt_error=0x7f27977e9960 "?") at
../../src/cm_common/cm_dep_tasks.c:1368
CUBRID#7 0x000000000043aadb in ts_userinfo (req=0x7f277c01dcb0,
res=0x7f277c00caa0, _dbmt_error=0x7f27977e9960 "?")
    at ../../../../cubridmanager/server/src/cm_job_task.cpp:743
CUBRID#8 0x0000000000474ede in ch_process_request (req=0x7f277c01dcb0,
res=0x7f277c00caa0) at
../../../../cubridmanager/server/src/cm_server_interface.cpp:296
CUBRID#9 0x0000000000475006 in cm_async_request_handler
(lpArg=0x7f279002e720) at
../../../../cubridmanager/server/src/cm_server_interface.cpp:483
CUBRID#10 0x00000038c9607851 in start_thread () from /lib64/libpthread.so.0
CUBRID#11 0x00000038c8ee767d in clone () from /lib64/libc.so.6
```
andrei14vl pushed a commit to andrei14vl/cubrid that referenced this pull request Apr 18, 2016
* [CBRD-20156] introduce light weight rwlock

* [CBRD-20156] release read_lock even if a reader suffers an error to hold/release global_lock

* [CBRD-21056] ';info csstat' session command also dumps statistics of rwlocks

* [CBRD-20156] fix a crash during shutdown of rwlock monitor

* [CBRD-20156] rwlock for SA_MODE, replace CSECT_QPROC_XASL_CACHE critical section with QEXEC_RWLOCK_XASL_CACHE rwlock.
@eseokoh eseokoh modified the milestone: banana pie May 12, 2017
ribram added a commit to ribram/cubrid that referenced this pull request May 21, 2021
* [SC-130] Remove XA related cas functions (CUBRID#4)

https://arniadb.atlassian.net/browse/SC-130

- remove cas_xa.c file from broker/cas
- remove fn_xa_prepare, fn_xa_recover and fn_xa_end_tran from server_fn_table. add assert to catch fetching NULL function from server_fn_table.
- replace `is_xa_prepared ()` with false (it was always false) and remove any related branches.
- remove `unset_xa_prepare_flag ()` from ux_end_tran

* [SC-131] remove parser code related to 2pc (CUBRID#5)

https://arniadb.atlassian.net/browse/SC-131

- remove grammar code and parser structures used for attach/prepare to commit commands
- remove all related functions from execute_statement, parse_tree_cl.c
- remove CUBRID_STMT_PREPARE and CUBRID_STMT_ATTACH from all enums (T_CCI_CUBRID_STMT, 2 x CUBRID_STMT_TYPE).
  - also remove SQLX_CMD_PREPARE and SQLX_CMD_ATTACH
  - the only usage of the CUBRID_STMT_PREPARE/CUBRID_STMT_ATTACH, via csql_Cmd_string_table, is to print the statement type when a query does not produce any results. It is not reachable, so removing it completely should have no side effects.

* [SC-132] remove cas_xa.c and all 2pc related dbi.h functions (CUBRID#8)

https://arniadb.atlassian.net/browse/SC-132

Remove DBI functions related to 2 phase commit.
Completely remove cas_xa.c (left behind by CUBRID#4)

* [SC-133] remove all 2pc functions from transaction/network files (CUBRID#9)

https://arniadb.atlassian.net/browse/SC-133

* [SC-134] Remove 2pc logic from log commit/abort (CUBRID#11)

https://arniadb.atlassian.net/browse/SC-134

Removing 2pc from all log module requires many changes. This is only a part of the task that modifies commit/abort functions.

- disable log_commit_local/log_abort_local from log_2pc.c, remove the is_local argument and the code for distributed transaction. also moved functions to log_manager.c
- remove 2pc code from log_commit/log_abort
  - NOTE: `LOG_ISTRAN_2PC_PREPARE (tdes)` and `log_2pc_clear_and_is_tran_distributed (tdes)` are replaced with false.
- delete log_complete_for_2pc body (will be completely removed in next patch)
- remove 2pc related comments.

* [SC-134] Remove log_tdes info related to 2pc (CUBRID#12)

https://arniadb.atlassian.net/browse/SC-134

Remove from log_tdes fields that are related to 2pc implementation: isloose_end, gtrinfo and coord.

Code branches are deleted by setting values to isloose_end false and too coord NULL.

- delete body of log_2pc.c functions that depended on these fields.
- remove log_recovery_redo code for 2pc records.
- remove isloose_end from checkpoint log record.
- remove logtb_dump_tdes_distribute_transaction

* [SC-134] Remove dump function for 2pc records (CUBRID#19)

https://arniadb.atlassian.net/browse/SC-134

Remove dump functions for 2pc records. These are last log_manager.c dependencies to 2pc.

* [SC-134] Remove 2pc fields from trantable (CUBRID#18)

https://arniadb.atlassian.net/browse/SC-134

- remove num_coord_loose_end_indices and num_prepared_loose_end_indices from trantable and all related code. Code branches have been cut using next values:
```
LOG_ISTRAN_2PC_INFORMING_PARTICIPANTS() = false
num_coord_loose_end_indices = 0
num_prepared_loose_end_indices = 0
```

- add constructor to trantable and remove TRANTABLE_INITIALIZER

* [SC-134] Remove 2pc transactions states (CUBRID#29)

https://arniadb.atlassian.net/browse/SC-134

Remove transaction states used for 2pc and all related code.

  - remove related log_impl macros and all their usage (replace by false).
  - remove log_recvphase.LOG_RECOVERY_FINISH_2PC_PHASE
  - disable bodies for 2pc recovery analysis functions (to be removed completely in next patch)

Add comments to obsolete error codes.

* [SC-134] Remove all remaining 2pc code from log/transaction modules (CUBRID#30)

https://arniadb.atlassian.net/browse/SC-134

- remove log_2pc files
- remove all record types and references
- remove all related functions (prior generate, recovery analysis)
- remove may_need_synch_checkpoint_2pc (= false) from recovery functions

Temporary using sc-134_rem_2pc_tran_states as destination, the goal is to merge into sc-126 directly.

* add back statement obsolete types

* add back to dbtype_def.h

* remove deleted functions from .def files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant