CUBRID Engine  latest
network_sr.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * network_sr.c - server side support functions.
21  */
22 
23 #ident "$Id$"
24 
25 #include "config.h"
26 
27 #include <stdio.h>
28 #include <string.h>
29 #include <assert.h>
30 
31 #if defined(CS_MODE)
32 #include "server_interface.h"
33 #else
34 #include "xserver_interface.h"
35 #endif
36 #include "boot_sr.h"
37 #include "connection_error.h"
38 #include "connection_sr.h"
39 #include "critical_section.h"
40 #include "event_log.h"
42 #include "log_impl.h"
43 #include "memory_alloc.h"
44 #include "message_catalog.h"
45 #include "network.h"
46 #include "network_interface_sr.h"
47 #include "perf_monitor.h"
48 #include "query_list.h"
49 #include "release_string.h"
50 #include "server_support.h"
51 #include "system_parameter.h"
52 #include "tz_support.h"
53 #include "util_func.h"
54 #if !defined(WINDOWS)
55 #include "tcp.h"
56 #else /* WINDOWS */
57 #include "wintcp.h"
58 #endif
59 #include "thread_entry.hpp"
60 #include "thread_manager.hpp"
61 
63 {
67  IN_TRANSACTION = 0x0008,
68  OUT_TRANSACTION = 0x0010,
69 };
70 typedef void (*net_server_func) (THREAD_ENTRY * thrd, unsigned int rid, char *request, int reqlen);
72 {
75  const char *name;
80 };
82 
83 static int net_Histo_call_count = 0;
84 
85 #if defined(CUBRID_DEBUG)
86 static void net_server_histo_print (void);
87 static void net_server_histo_add_entry (int request, int data_sent);
88 #endif /* CUBRID_DEBUG */
89 
90 static void net_server_init (void);
91 static int net_server_request (THREAD_ENTRY * thread_p, unsigned int rid, int request, int size, char *buffer);
92 static int net_server_conn_down (THREAD_ENTRY * thread_p, CSS_THREAD_ARG arg);
93 
94 
95 /*
96  * net_server_init () -
97  * return:
98  */
99 static void
101 {
102  struct net_request *req_p;
103  unsigned int i;
104 
106 
107  for (i = 0; i < DIM (net_Requests); i++)
108  {
111  net_Requests[i].name = "";
116  }
117 
118  /* ping */
119  req_p = &net_Requests[NET_SERVER_PING];
121  req_p->name = "NET_SERVER_PING";
122 
123  /* boot */
126  req_p->name = "NET_SERVER_BO_INIT_SERVER";
127 
130  req_p->name = "NET_SERVER_BO_REGISTER_CLIENT";
131 
134  req_p->name = "NET_SERVER_BO_UNREGISTER_CLIENT";
135 
139  req_p->name = "NET_SERVER_BO_BACKUP";
140 
144  req_p->name = "NET_SERVER_BO_ADD_VOLEXT";
145 
149  req_p->name = "NET_SERVER_BO_CHECK_DBCONSISTENCY";
150 
153  req_p->name = "NET_SERVER_BO_FIND_NPERM_VOLS";
154 
157  req_p->name = "NET_SERVER_BO_FIND_NTEMP_VOLS";
158 
161  req_p->name = "NET_SERVER_BO_FIND_LAST_PERM";
162 
165  req_p->name = "NET_SERVER_BO_FIND_LAST_TEMP";
166 
170  req_p->name = "NET_SERVER_BO_CHANGE_HA_MODE";
171 
175  req_p->name = "NET_SERVER_BO_NOTIFY_HA_LOG_APPLIER_STATE";
176 
180  req_p->name = "NET_SERVER_BO_COMPACT_DB";
181 
185  req_p->name = "NET_SERVER_BO_HEAP_COMPACT";
186 
190  req_p->name = "NET_SERVER_BO_COMPACT_DB_START";
191 
195  req_p->name = "NET_SERVER_BO_COMPACT_DB_STOP";
196 
199  req_p->name = "NET_SERVER_BO_GET_LOCALES_INFO";
200 
201  /* transaction */
205  req_p->name = "NET_SERVER_TM_SERVER_COMMIT";
206 
210  req_p->name = "NET_SERVER_TM_SERVER_ABORT";
211 
215  req_p->name = "NET_SERVER_TM_SERVER_START_TOPOP";
216 
220  req_p->name = "NET_SERVER_TM_SERVER_END_TOPOP";
221 
225  req_p->name = "NET_SERVER_TM_SERVER_SAVEPOINT";
226 
230  req_p->name = "NET_SERVER_TM_SERVER_PARTIAL_ABORT";
231 
234  req_p->name = "NET_SERVER_TM_SERVER_HAS_UPDATED";
235 
238  req_p->name = "NET_SERVER_TM_SERVER_ISACTIVE_AND_HAS_UPDATED";
239 
242  req_p->name = "NET_SERVER_TM_ISBLOCKED";
243 
247  req_p->name = "NET_SERVER_TM_WAIT_SERVER_ACTIVE_TRANS";
248 
252  req_p->name = "NET_SERVER_TM_SERVER_GET_GTRINFO";
253 
257  req_p->name = "NET_SERVER_TM_SERVER_SET_GTRINFO";
258 
262  req_p->name = "NET_SERVER_TM_SERVER_2PC_START";
263 
267  req_p->name = "NET_SERVER_TM_SERVER_2PC_PREPARE";
268 
272  req_p->name = "NET_SERVER_TM_SERVER_2PC_RECOVERY_PREPARED";
273 
277  req_p->name = "NET_SERVER_TM_SERVER_2PC_ATTACH_GT";
278 
282  req_p->name = "NET_SERVER_TM_SERVER_2PC_PREPARE_GT";
283 
286  req_p->name = "NET_SERVER_TM_LOCAL_TRANSACTION_ID";
287 
288  /* locator */
292  req_p->name = "NET_SERVER_LC_FETCH";
293 
297  req_p->name = "NET_SERVER_LC_FETCHALL";
298 
302  req_p->name = "NET_SERVER_LC_FETCH_LOCKSET";
303 
307  req_p->name = "NET_SERVER_LC_FETCH_ALLREFS_LOCKSET";
308 
312  req_p->name = "NET_SERVER_LC_GET_CLASS";
313 
317  req_p->name = "NET_SERVER_LC_FIND_CLASSOID";
318 
322  req_p->name = "NET_SERVER_LC_DOESEXIST";
323 
327  req_p->name = "NET_SERVER_LC_FORCE";
328 
332  req_p->name = "NET_SERVER_LC_RESERVE_CLASSNAME";
333 
337  req_p->name = "NET_SERVER_LC_RESERVE_CLASSNAME_GET_OID";
338 
342  req_p->name = "NET_SERVER_LC_DELETE_CLASSNAME";
343 
347  req_p->name = "NET_SERVER_LC_RENAME_CLASSNAME";
348 
352  req_p->name = "NET_SERVER_LC_ASSIGN_OID";
353 
357  req_p->name = "NET_SERVER_LC_NOTIFY_ISOLATION_INCONS";
358 
362  req_p->name = "NET_SERVER_LC_FIND_LOCKHINT_CLASSOIDS";
363 
367  req_p->name = "NET_SERVER_LC_FETCH_LOCKHINT_CLASSES";
368 
372  req_p->name = "NET_SERVER_LC_ASSIGN_OID_BATCH";
373 
377  req_p->name = "NET_SERVER_LC_CHECK_FK_VALIDITY";
378 
382  req_p->name = "NET_SERVER_LC_REM_CLASS_FROM_INDEX";
383 
387  req_p->name = "NET_SERVER_LC_UPGRADE_INSTANCES_DOMAIN";
388 
392  req_p->name = "NET_SERVER_LC_REPL_FORCE";
393 
394  /* redistribute partition data */
398  req_p->name = "NET_SERVER_LC_REDISTRIBUTE_PARTITION_DATA";
399 
403  req_p->name = "NET_SERVER_LC_DEMOTE_CLASS_LOCK";
404 
405  /* heap */
409  req_p->name = "NET_SERVER_HEAP_CREATE";
410 
414  req_p->name = "NET_SERVER_HEAP_DESTROY";
415 
419  req_p->name = "NET_SERVER_HEAP_DESTROY_WHEN_NEW";
420 
424  req_p->name = "NET_SERVER_HEAP_GET_CLASS_NOBJS_AND_NPAGES";
425 
429  req_p->name = "NET_SERVER_HEAP_HAS_INSTANCE";
430 
434  req_p->name = "NET_SERVER_HEAP_RECLAIM_ADDRESSES";
435 
436  /* file */
440  req_p->name = "NET_SERVER_FILE_APPLY_TDE_TO_CLASS_FILES";
441 
442  /* tde */
445  req_p->name = "NET_SERVER_TDE_GET_DATA_KEYS";
446 
449  req_p->name = "NET_SERVER_TDE_GET_MK_FILE_PATH";
450 
453  req_p->name = "NET_SERVER_TDE_GET_MK_INFO";
454 
457  req_p->name = "NET_SERVER_TDE_CHANGE_MK_ON_SERVER";
458 
459  /* log */
462  req_p->name = "NET_SERVER_LOG_RESET_WAIT_MSECS";
463 
466  req_p->name = "NET_SERVER_LOG_RESET_ISOLATION";
467 
471  req_p->name = "NET_SERVER_LOG_SET_INTERRUPT";
472 
475  req_p->name = "NET_SERVER_LOG_DUMP_STAT";
476 
479  req_p->name = "NET_SERVER_LOG_GETPACK_TRANTB";
480 
483  req_p->name = "NET_SERVER_LOG_DUMP_TRANTB";
484 
487  req_p->name = "NET_SERVER_LOG_FIND_LOB_LOCATOR";
488 
491  req_p->name = "NET_SERVER_LOG_ADD_LOB_LOCATOR";
492 
495  req_p->name = "NET_SERVER_LOG_CHANGE_STATE_OF_LOCATOR";
496 
499  req_p->name = "NET_SERVER_LOG_DROP_LOB_LOCATOR";
500 
503  req_p->name = "NET_SERVER_LOG_CHECKPOINT";
504 
508  req_p->name = "NET_SERVER_LOG_SET_SUPPRESS_REPL_ON_TRANSACTION";
509 
510  /* lock */
513  req_p->name = "NET_SERVER_LK_DUMP";
514 
515  /* b-tree */
519  req_p->name = "NET_SERVER_BTREE_ADDINDEX";
520 
524  req_p->name = "NET_SERVER_BTREE_DELINDEX";
525 
529  req_p->name = "NET_SERVER_BTREE_LOADINDEX";
530 
534  req_p->name = "NET_SERVER_BTREE_FIND_UNIQUE";
535 
539  req_p->name = "NET_SERVER_BTREE_CLASS_UNIQUE_TEST";
540 
544  req_p->name = "NET_SERVER_BTREE_GET_STATISTICS";
545 
549  req_p->name = "NET_SERVER_BTREE_GET_KEY_TYPE";
550 
551  /* disk */
554  req_p->name = "NET_SERVER_DISK_TOTALPGS";
555 
558  req_p->name = "NET_SERVER_DISK_FREEPGS";
559 
562  req_p->name = "NET_SERVER_DISK_REMARKS";
563 
566  req_p->name = "NET_SERVER_DISK_VLABEL";
567 
568  /* statistics */
572  req_p->name = "NET_SERVER_QST_GET_STATISTICS";
573 
577  req_p->name = "NET_SERVER_QST_UPDATE_STATISTICS";
578 
582  req_p->name = "NET_SERVER_QST_UPDATE_ALL_STATISTICS";
583 
584  /* query manager */
588  req_p->name = "NET_SERVER_QM_QUERY_PREPARE";
589 
593  req_p->name = "NET_SERVER_QM_QUERY_EXECUTE";
594 
598  req_p->name = "NET_SERVER_QM_QUERY_PREPARE_AND_EXECUTE";
599 
603  req_p->name = "NET_SERVER_QM_QUERY_END";
604 
607  req_p->name = "NET_SERVER_QM_QUERY_DROP_ALL_PLANS";
608 
611  req_p->name = "NET_SERVER_QM_QUERY_DUMP_PLANS";
612 
615  req_p->name = "NET_SERVER_QM_QUERY_DUMP_CACHE";
616 
617  /* query file */
621  req_p->name = "NET_SERVER_LS_GET_LIST_FILE_PAGE";
622 
623  /* monitor */
627  req_p->name = "NET_SERVER_MNT_SERVER_START_STATS";
628 
632  req_p->name = "NET_SERVER_MNT_SERVER_STOP_STATS";
633 
637  req_p->name = "NET_SERVER_MNT_SERVER_COPY_STATS";
638 
639  /* catalog */
643  req_p->name = "NET_SERVER_CT_CHECK_REP_DIR";
644 
645  /* thread */
649  req_p->name = "NET_SERVER_CSS_KILL_TRANSACTION";
650 
654  req_p->name = "NET_SERVER_CSS_DUMP_CS_STAT";
655 
656  /* query processing */
660  req_p->name = "NET_SERVER_QPROC_GET_SYS_TIMESTAMP";
661 
665  req_p->name = "NET_SERVER_QPROC_GET_CURRENT_VALUE";
666 
670  req_p->name = "NET_SERVER_QPROC_GET_NEXT_VALUE";
671 
675  req_p->name = "NET_SERVER_SERIAL_DECACHE";
676 
680  req_p->name = "NET_SERVER_QPROC_GET_SERVER_INFO";
681 
682  /* parameter */
685  req_p->name = "NET_SERVER_PRM_SET_PARAMETERS";
686 
689  req_p->name = "NET_SERVER_PRM_GET_PARAMETERS";
690 
693  req_p->name = "NET_SERVER_PRM_GET_FORCE_PARAMETERS";
694 
697  req_p->name = "NET_SERVER_PRM_DUMP_PARAMETERS";
698 
699  /* JSP */
703  req_p->name = "NET_SERVER_JSP_GET_SERVER_PORT";
704 
705  /* replication */
709  req_p->name = "NET_SERVER_REPL_INFO";
710 
714  req_p->name = "NET_SERVER_REPL_LOG_GET_APPEND_LSA";
715 
716  /* log writer */
720  req_p->name = "NET_SERVER_LOGWR_GET_LOG_PAGES";
721 
722  /* shutdown */
725  req_p->name = "NET_SERVER_SHUTDOWN";
726 
727  /* monitor */
731  req_p->name = "NET_SERVER_MNT_SERVER_COPY_GLOBAL_STATS";
732 
733  /* esternal storage supports */
737  req_p->name = "NET_SERVER_ES_CREATE_FILE";
738 
742  req_p->name = "NET_SERVER_ES_WRITE_FILE";
743 
747  req_p->name = "NET_SERVER_ES_READ_FILE";
748 
752  req_p->name = "NET_SERVER_ES_DELETE_FILE";
753 
757  req_p->name = "NET_SERVER_ES_COPY_FILE";
758 
762  req_p->name = "NET_SERVER_ES_RENAME_FILE";
763 
767  req_p->name = "NET_SERVER_ES_GET_FILE_SIZE";
768 
769  /* session state */
772  req_p->name = "NET_SERVER_SES_CHECK_SESSION";
773 
776  req_p->name = "NET_SERVER_END_SESSION";
777 
780  req_p->name = "NET_SERVER_SET_ROW_COUNT";
781 
784  req_p->name = "NET_SERVER_GET_ROW_COUNT";
785 
788  req_p->name = "NET_SERVER_SES_GET_LAST_INSERT_ID";
789 
792  req_p->name = "NET_SERVER_SES_RESET_CUR_INSERT_ID";
793 
796  req_p->name = "NET_SERVER_SES_CREATE_PREPARED_STATEMENT";
797 
800  req_p->name = "NET_SERVER_SES_GET_PREPARED_STATEMENT";
801 
804  req_p->name = "NET_SERVER_SES_DELETE_PREPARED_STATEMENT";
805 
808  req_p->name = "NET_SERVER_SES_SET_SESSION_VARIABLES";
809 
812  req_p->name = "NET_SERVER_SES_GET_SESSION_VARIABLE";
813 
816  req_p->name = "NET_SERVER_SES_DROP_SESSION_VARIABLES";
817 
818  /* ip control */
821  req_p->name = "NET_SERVER_ACL_DUMP";
822 
825  req_p->name = "NET_SERVER_ACL_RELOAD";
826 
829  req_p->name = "NET_SERVER_SET_USERNAME";
830 
833  req_p->name = "NET_SERVER_FIND_MULTI_UNIQUES";
834 
837  req_p->name = "NET_SERVER_CSS_KILL_OR_INTERRUPT_TRANSACTION";
838 
840  req_p->processing_function = svacuum;
841  req_p->name = "NET_SERVER_VACUUM";
842 
845  req_p->name = "NET_SERVER_GET_MVCC_SNAPSHOT";
846 
849  req_p->name = "NET_SERVER_LOCK_RR";
850 
853  req_p->name = "NET_SERVER_TZ_GET_CHECKSUM";
854 
857  req_p->name = "NET_SERVER_SPACEDB";
858 
859  /* loaddb server requests */
862  req_p->name = "NET_SERVER_LD_INIT";
863 
866  req_p->name = "NET_SERVER_LD_INSTALL_CLASS";
867 
870  req_p->name = "NET_SERVER_LD_LOAD_BATCH";
871 
874  req_p->name = "NET_SERVER_LD_FETCH_STATUS";
875 
878  req_p->name = "NET_SERVER_LD_DESTROY";
879 
882  req_p->name = "NET_SERVER_LD_INTERRUPT";
883 
886  req_p->name = "NET_SERVER_LD_UPDATE_STATS";
887 
888  /* checksumdb replication */
892  req_p->name = "NET_SERVER_CHKSM_REPL";
893 
894  /* check active user exist or not */
898  req_p->name = "NET_SERVER_AU_DOES_ACTIVE_USER_EXIST";
899 
902  req_p->name = "NET_SERVER_VACUUM_DUMP";
903 
904 }
905 
906 #if defined(CUBRID_DEBUG)
907 /*
908  * net_server_histo_print () -
909  * return:
910  */
911 static void
912 net_server_histo_print (void)
913 {
914  unsigned int i, found = 0, total_requests = 0, total_size_sent = 0;
915  int total_size_received = 0;
916  float server_time, total_server_time = 0;
917  float avg_response_time, avg_client_time;
918 
919  fprintf (stdout, "\nHistogram of client requests:\n");
920  fprintf (stdout, "%-31s %6s %10s %10s , %10s \n", "Name", "Rcount", "Sent size", "Recv size", "Server time");
921 
922  for (i = 0; i < DIM (net_Requests); i++)
923  {
925  {
926  found = 1;
927  server_time = ((float) net_Requests[i].elapsed_time / 1000000 / (float) (net_Requests[i].request_count));
928  fprintf (stdout, "%-29s %6d X %10d+%10d b, %10.6f s\n", net_Requests[i].name, net_Requests[i].request_count,
929  net_Requests[i].total_size_sent, net_Requests[i].total_size_received, server_time);
930  total_requests += net_Requests[i].request_count;
931  total_size_sent += net_Requests[i].total_size_sent;
932  total_size_received += net_Requests[i].total_size_received;
933  total_server_time += (server_time * net_Requests[i].request_count);
934  }
935  }
936 
937  if (!found)
938  {
939  fprintf (stdout, " No server requests made\n");
940  }
941  else
942  {
943  fprintf (stdout, "-------------------------------------------------------------" "--------------\n");
944  fprintf (stdout, "Totals: %6d X %10d+%10d b " "%10.6f s\n", total_requests,
945  total_size_sent, total_size_received, total_server_time);
946  avg_response_time = total_server_time / total_requests;
947  avg_client_time = 0.0;
948  fprintf (stdout,
949  "\n Average server response time = %6.6f secs \n"
950  " Average time between client requests = %6.6f secs \n", avg_response_time, avg_client_time);
951  }
952 }
953 
954 /*
955  * net_server_histo_add_entry () -
956  * return:
957  * request(in):
958  * data_sent(in):
959  */
960 static void
961 net_server_histo_add_entry (int request, int data_sent)
962 {
963  net_Requests[request].request_count++;
964  net_Requests[request].total_size_sent += data_sent;
965 
967 }
968 #endif /* CUBRID_DEBUG */
969 
970 /*
971  * net_server_request () - The main server request dispatch handler
972  * return: error status
973  * thrd(in): this thread handle
974  * rid(in): CSS request id
975  * request(in): request constant
976  * size(in): size of argument buffer
977  * buffer(in): argument buffer
978  */
979 static int
980 net_server_request (THREAD_ENTRY * thread_p, unsigned int rid, int request, int size, char *buffer)
981 {
982  net_server_func func;
983  int status = CSS_NO_ERRORS;
984  int error_code;
985  CSS_CONN_ENTRY *conn;
986 
987  if (buffer == NULL && size > 0)
988  {
990  return_error_to_client (thread_p, rid);
991  status = CSS_UNPLANNED_SHUTDOWN;
992  goto end;
993  }
994 
995  /* handle some special requests */
996  if (request == NET_SERVER_PING_WITH_HANDSHAKE)
997  {
998  status = server_ping_with_handshake (thread_p, rid, buffer, size);
999  goto end;
1000  }
1001  else if (request == NET_SERVER_SHUTDOWN)
1002  {
1004  /* When this actually does a shutdown, change to CSS_PLANNED_SHUTDOWN */
1005  status = CSS_UNPLANNED_SHUTDOWN;
1006  goto end;
1007  }
1008 
1009  if (request <= NET_SERVER_REQUEST_START || request >= NET_SERVER_REQUEST_END)
1010  {
1012  return_error_to_client (thread_p, rid);
1013  goto end;
1014  }
1015 #if defined(CUBRID_DEBUG)
1016  net_server_histo_add_entry (request, size);
1017 #endif /* CUBRID_DEBUG */
1018  conn = thread_p->conn_entry;
1019  assert (conn != NULL);
1020  /* check if the conn is valid */
1021  if (IS_INVALID_SOCKET (conn->fd) || conn->status != CONN_OPEN)
1022  {
1023  /* have nothing to do because the client has gone */
1024  goto end;
1025  }
1026 
1027  /* check the defined action attribute */
1029  {
1030  int client_type;
1031  bool check = true;
1032 
1033  if (request == NET_SERVER_TM_SERVER_COMMIT)
1034  {
1035  if (!logtb_has_updated (thread_p))
1036  {
1037  check = false;
1038  }
1039  }
1040  /* check if DB modification is allowed */
1041  client_type = logtb_find_client_type (thread_p->tran_index);
1042  if (check)
1043  {
1044  CHECK_MODIFICATION_NO_RETURN (thread_p, error_code);
1045  if (error_code != NO_ERROR)
1046  {
1047  er_log_debug (ARG_FILE_LINE, "net_server_request(): CHECK_DB_MODIFICATION error" " request %s\n",
1048  net_Requests[request].name);
1049  return_error_to_client (thread_p, rid);
1050  css_send_abort_to_client (conn, rid);
1051  goto end;
1052  }
1053  }
1054  }
1056  {
1057  if (!logtb_am_i_dba_client (thread_p))
1058  {
1059  er_log_debug (ARG_FILE_LINE, "net_server_request(): CHECK_AUTHORIZATION error" " request %s\n",
1060  net_Requests[request].name);
1062  return_error_to_client (thread_p, rid);
1063  css_send_abort_to_client (conn, rid);
1064  goto end;
1065  }
1066  }
1068  {
1069  conn->in_transaction = true;
1070  }
1071 
1072  /* call a request processing function */
1073  if (thread_p->tran_index > 0)
1074  {
1076  }
1077  func = net_Requests[request].processing_function;
1078  assert (func != NULL);
1079  if (func)
1080  {
1082  {
1083  _er_log_debug (ARG_FILE_LINE, "net_server_request(): request %s\n", net_Requests[request].name);
1084  }
1085 
1086  thread_p->push_resource_tracks ();
1087 
1088  if (conn->invalidate_snapshot != 0)
1089  {
1090  logtb_invalidate_snapshot_data (thread_p);
1091  }
1092  (*func) (thread_p, rid, buffer, size);
1093 
1094  thread_p->pop_resource_tracks ();
1095 
1096  /* defence code: let other threads continue. */
1097  pgbuf_unfix_all (thread_p);
1098  }
1099 
1100  /* check the defined action attribute */
1102  {
1103  conn->in_transaction = false;
1104  }
1105 
1106 end:
1107  if (buffer != NULL && size > 0)
1108  {
1109  free_and_init (buffer);
1110  }
1111 
1112  /* clear memory to be used at request handling */
1113  db_clear_private_heap (thread_p, 0);
1114 
1115  return (status);
1116 }
1117 
1118 /*
1119  * net_server_conn_down () - CSS callback function used when a connection to a
1120  * particular client went down
1121  * return: 0
1122  * arg(in): transaction id
1123  */
1124 static int
1126 {
1127  int tran_index;
1128  CSS_CONN_ENTRY *conn_p;
1129  size_t prev_thrd_cnt, thrd_cnt;
1130  bool continue_check;
1131  int client_id;
1132  int local_tran_index;
1133  THREAD_ENTRY *suspended_p;
1134  size_t loop_count_for_pending_request = 0;
1135 
1136  if (thread_p == NULL)
1137  {
1138  thread_p = thread_get_thread_entry_info ();
1139  if (thread_p == NULL)
1140  {
1141  return 0;
1142  }
1143  }
1144 
1145  local_tran_index = thread_p->tran_index;
1146 
1147  conn_p = (CSS_CONN_ENTRY *) arg;
1148  tran_index = conn_p->get_tran_index ();
1149  client_id = conn_p->client_id;
1150 
1151  css_set_thread_info (thread_p, client_id, 0, tran_index, NET_SERVER_SHUTDOWN);
1152  pthread_mutex_unlock (&thread_p->tran_index_lock);
1153 
1154  css_end_server_request (conn_p);
1155 
1156  /* avoid infinite waiting with xtran_wait_server_active_trans() */
1157  thread_p->m_status = cubthread::entry::status::TS_CHECK;
1158 
1159  if (conn_p->session_p != NULL)
1160  {
1161  ssession_stop_attached_threads (conn_p->session_p);
1162  }
1163 
1164 loop:
1165  prev_thrd_cnt = css_count_transaction_worker_threads (thread_p, tran_index, client_id);
1166  if (prev_thrd_cnt > 0)
1167  {
1168  if (tran_index == NULL_TRAN_INDEX)
1169  {
1170  /* the connected client does not yet finished boot_client_register */
1171  thread_sleep (50); /* 50 msec */
1172  tran_index = conn_p->get_tran_index ();
1173  }
1174  if (!logtb_is_interrupted_tran (thread_p, false, &continue_check, tran_index))
1175  {
1176  logtb_set_tran_index_interrupt (thread_p, tran_index, true);
1177  }
1178 
1179  /* never try to wake non TRAN_ACTIVE state trans. note that non-TRAN_ACTIVE trans will not be interrupted. */
1180  if (logtb_is_interrupted_tran (thread_p, false, &continue_check, tran_index))
1181  {
1182  suspended_p = logtb_find_thread_by_tran_index_except_me (tran_index);
1183  if (suspended_p != NULL)
1184  {
1185  bool wakeup_now = false;
1186 
1187  thread_lock_entry (suspended_p);
1188 
1189  if (suspended_p->check_interrupt)
1190  {
1191  switch (suspended_p->resume_status)
1192  {
1196  case THREAD_LOCK_SUSPENDED:
1199  /* never try to wake thread up while the thread is waiting for a critical section or a lock. */
1200  wakeup_now = false;
1201  break;
1207  wakeup_now = true;
1208  break;
1209 
1210  case THREAD_RESUME_NONE:
1213  case THREAD_PGBUF_RESUMED:
1220  case THREAD_LOCK_RESUMED:
1221  case THREAD_LOGWR_RESUMED:
1224  /* thread is in resumed status, we don't need to wake up */
1225  wakeup_now = false;
1226  break;
1227  default:
1228  assert (false);
1229  wakeup_now = false;
1230  break;
1231  }
1232  }
1233 
1234  if (wakeup_now == true)
1235  {
1237  }
1238  thread_unlock_entry (suspended_p);
1239  }
1240  }
1241  }
1242 
1243  while ((thrd_cnt = css_count_transaction_worker_threads (thread_p, tran_index, client_id)) >= prev_thrd_cnt
1244  && thrd_cnt > 0)
1245  {
1246  /* Some threads may wait for data from the m-driver. It's possible from the fact that css_server_thread() is
1247  * responsible for receiving every data from which is sent by a client and all m-drivers. We must have chance to
1248  * receive data from them. */
1249  thread_sleep (50); /* 50 msec */
1250  }
1251 
1252  if (thrd_cnt > 0)
1253  {
1254  goto loop;
1255  }
1256 
1257  if (conn_p->has_pending_request () && !css_is_shutdowning_server ())
1258  {
1259  // need to wait for pending request
1260  thread_sleep (50); /* 50 msec */
1261  if (++loop_count_for_pending_request >= 10)
1262  {
1263  // too long...
1264  assert (false);
1265  }
1266  else
1267  {
1268  goto loop;
1269  }
1270  }
1271 
1272  logtb_set_tran_index_interrupt (thread_p, tran_index, false);
1273 
1274  if (tran_index != NULL_TRAN_INDEX)
1275  {
1276  (void) xboot_unregister_client (thread_p, tran_index);
1277  }
1278  css_free_conn (conn_p);
1279 
1280  css_set_thread_info (thread_p, -1, 0, local_tran_index, -1);
1281  thread_p->m_status = cubthread::entry::status::TS_RUN;
1282 
1283  return NO_ERROR;
1284 }
1285 
1286 /*
1287  * net_server_start () - Starts the operation of a CUBRID server
1288  * return: error status
1289  * server_name(in): name of server
1290  */
1291 int
1292 net_server_start (const char *server_name)
1293 {
1294  int error = NO_ERROR;
1295  int name_length;
1296  char *packed_name;
1297  int r, status = 0;
1298  CHECK_ARGS check_coll_and_timezone = { true, true };
1299  THREAD_ENTRY *thread_p = NULL;
1300 
1301  if (er_init (NULL, ER_NEVER_EXIT) != NO_ERROR)
1302  {
1303  PRINT_AND_LOG_ERR_MSG ("Failed to initialize error manager\n");
1304  status = -1;
1305  goto end;
1306  }
1307 
1308  cubthread::initialize (thread_p);
1310  assert (thread_p == thread_get_thread_entry_info ());
1311 
1312 #if defined(WINDOWS)
1313  if (css_windows_startup () < 0)
1314  {
1315  printf ("Winsock startup error\n");
1316  return -1;
1317  }
1318 #endif /* WINDOWS */
1319 
1320  /* open the system message catalog, before prm_ ? */
1321  if (msgcat_init () != NO_ERROR)
1322  {
1323  PRINT_AND_LOG_ERR_MSG ("Failed to initialize message catalog\n");
1324  status = -1;
1325  goto end;
1326  }
1327 
1328  /* initialize time zone data, optional module */
1329  if (tz_load () != NO_ERROR)
1330  {
1331  status = -1;
1332  goto end;
1333  }
1334 
1336  sysprm_set_er_log_file (server_name);
1337 
1339  {
1340  PRINT_AND_LOG_ERR_MSG ("Failed to initialize synchronization primitives monitor\n");
1341  status = -1;
1342  goto end;
1343  }
1345  {
1346  PRINT_AND_LOG_ERR_MSG ("Failed to initialize critical section\n");
1347  status = -1;
1348  goto end;
1349  }
1350 
1351  // we already initialize er_init with default values, we'll reload again after loading database parameters
1352  // this call looks unnecessary.
1353  // we can either remove this completely, or we can add an er_update to check if parameters are changed and do
1354  // whatever is necessary
1356  {
1357  PRINT_AND_LOG_ERR_MSG ("Failed to initialize error manager\n");
1358  status = -1;
1359  goto end;
1360  }
1361 
1362  net_server_init ();
1364 
1365  if (boot_restart_server (thread_p, true, server_name, false, &check_coll_and_timezone, NULL, false) != NO_ERROR)
1366  {
1367  assert (er_errid () != NO_ERROR);
1368  error = er_errid ();
1369  }
1370  else
1371  {
1372  packed_name = css_pack_server_name (server_name, &name_length);
1373 
1374  r = css_init (thread_p, packed_name, name_length, prm_get_integer_value (PRM_ID_TCP_PORT_ID));
1375  free_and_init (packed_name);
1376 
1377  if (r < 0)
1378  {
1379  assert (er_errid () != NO_ERROR);
1380  error = er_errid ();
1381 
1382  if (error == NO_ERROR)
1383  {
1384  error = ER_NET_NO_MASTER;
1385  er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, error, 0);
1386  }
1387 
1389  }
1390  else
1391  {
1392  (void) xboot_shutdown_server (thread_p, ER_THREAD_FINAL);
1393  }
1394 
1395 #if defined(CUBRID_DEBUG)
1396  net_server_histo_print ();
1397 #endif /* CUBRID_DEBUG */
1398 
1401  }
1402 
1403  if (error != NO_ERROR)
1404  {
1405  PRINT_AND_LOG_ERR_MSG ("%s\n", er_msg ());
1406  fflush (stderr);
1407  status = 2;
1408  }
1409 
1414  (void) sync_finalize_sync_stats ();
1415 
1416 end:
1417 #if defined(WINDOWS)
1419 #endif /* WINDOWS */
1420 
1421  return status;
1422 }
1423 
1424 /*
1425  * net_cleanup_server_queues () -
1426  * return:
1427  * rid(in):
1428  */
1429 void
1430 net_cleanup_server_queues (unsigned int rid)
1431 {
1433 }
1434 
1435 /*
1436  * net_server_request_name () - get the request name in net_Requests array
1437  * return:
1438  * request(in): the request index in net_Requests array.
1439  */
1440 const char *
1442 {
1443  if (NET_SERVER_REQUEST_START < request || request < NET_SERVER_REQUEST_END)
1444  {
1445  /* skip NET_SERVER_ */
1446  return (net_Requests[request].name + sizeof ("NET_SERVER_") - 1);
1447  }
1448  else if (request == NET_SERVER_PING_WITH_HANDSHAKE)
1449  {
1450  return "PING_WITH_HANDSHAKE";
1451  }
1452  else
1453  {
1454  return "UNKNOWN";
1455  }
1456 }
void stran_server_2pc_recovery_prepared(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sloaddb_destroy(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
static struct net_request net_Requests[NET_SERVER_REQUEST_END]
Definition: network_sr.c:81
static int net_server_conn_down(THREAD_ENTRY *thread_p, CSS_THREAD_ARG arg)
Definition: network_sr.c:1125
int status
void sbtree_delete_index(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slog_drop_lob_locator(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_check_db_consistency(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sbtree_find_unique(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
static void net_server_init(void)
Definition: network_sr.c:100
const char * name
Definition: network_sr.c:75
void stran_server_is_active_and_has_updated(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
cubthread::entry * thread_get_thread_entry_info(void)
#define NO_ERROR
Definition: error_code.h:46
void stran_server_2pc_prepare(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sthread_kill_tran_index(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void shf_heap_reclaim_addresses(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_2pc_start(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_find_or_create_session(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_savepoint(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_get_locales_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int css_init(THREAD_ENTRY *thread_p, char *server_name, int name_length, int port_id)
void ssession_create_prepared_statement(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqfile_get_list_file_page(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_get_row_count(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int sync_finalize_sync_stats(void)
void slocator_upgrade_instances_domain(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define PRINT_AND_LOG_ERR_MSG(...)
Definition: util_func.h:49
size_t css_count_transaction_worker_threads(THREAD_ENTRY *thread_p, int tran_index, int client_id)
void slocator_fetch_all(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sbtree_get_statistics(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_fetch(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stde_change_mk_on_server(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_fetch_lockhint_classes(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_has_updated(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void smnt_server_stop_stats(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stde_get_mk_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_reset_cur_insert_id(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_lock_rep_read(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_add_volume_extension(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_find_last_permanent(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void server_ping(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void css_free_conn(CSS_CONN_ENTRY *conn)
const char * net_server_request_name(int request)
Definition: network_sr.c:1441
int boot_restart_server(THREAD_ENTRY *thread_p, bool print_restart, const char *db_name, bool from_backup, CHECK_ARGS *check_coll_and_timezone, BO_RESTART_ARG *r_args, bool skip_vacuum)
Definition: boot_sr.c:2046
void slog_add_lob_locator(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define pthread_mutex_unlock(a)
Definition: area_alloc.c:51
void sprm_server_get_force_parameters(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void css_final_conn_list(void)
void sserial_get_current_value(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_wait_server_active_trans(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ses_posix_copy_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void pgbuf_unfix_all(THREAD_ENTRY *thread_p)
Definition: page_buffer.c:2656
void sboot_compact_db(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool logtb_set_tran_index_interrupt(THREAD_ENTRY *thread_p, int tran_index, bool set)
void thread_sleep(double millisec)
void stran_server_commit(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_notify_unregister_client(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void thread_wakeup_already_had_mutex(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason)
void stran_server_2pc_attach_global_tran(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
THREAD_ENTRY * logtb_find_thread_by_tran_index_except_me(int tran_index)
void css_initialize_server_interfaces(int(*request_handler)(THREAD_ENTRY *thrd, unsigned int eid, int request, int size, char *buffer), CSS_THREAD_FN connection_error_function)
SOCKET fd
void slogtb_set_interrupt(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_compact_start(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void smnt_server_copy_global_stats(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqmgr_dump_query_plans(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_get_local_transaction_id(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int tz_load(void)
Definition: tz_support.c:337
void ssession_get_last_insert_id(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_redistribute_partition_data(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int er_errid(void)
void css_set_thread_info(THREAD_ENTRY *thread_p, int client_id, int rid, int tran_index, int net_request_index)
void sboot_register_client(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slog_change_state_of_locator(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_partial_abort(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int total_size_received
Definition: network_sr.c:78
void sbtree_find_multi_uniques(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define er_log_debug(...)
void sprm_server_dump_parameters(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogtb_get_mvcc_snapshot(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_reserve_classnames(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void _er_log_debug(const char *file_name, const int line_no, const char *fmt,...)
void slogtb_dump_trantable(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ses_posix_delete_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int er_init(const char *msglog_filename, int exit_ask)
void slocator_fetch_lockset(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sprm_server_obtain_parameters(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sserial_decache(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void shf_get_class_num_objs_and_pages(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_start_topop(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_delete_class_name(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void THREAD_ENTRY
void stran_is_blocked(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sacl_dump(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int elapsed_time
Definition: network_sr.c:79
void sloaddb_update_stats(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqmgr_end_query(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sthread_kill_or_interrupt_tran(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_get_reserved_class_name_oid(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
net_req_act
Definition: network_sr.c:62
void slog_find_lob_locator(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
void sqmgr_execute_query(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_demote_class_lock(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void db_clear_private_heap(THREAD_ENTRY *thread_p, HL_HEAPID heap_id)
Definition: memory_alloc.c:314
#define assert(x)
void er_final(ER_FINAL_CODE do_global_final)
void sysprm_set_er_log_file(const char *db_name)
void * CSS_THREAD_ARG
void sloaddb_fetch_status(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_set_session_variables(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int prm_get_integer_value(PARAM_ID prm_id)
void sdk_totalpgs(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
static int net_server_request(THREAD_ENTRY *thread_p, unsigned int rid, int request, int size, char *buffer)
Definition: network_sr.c:980
void ssession_get_prepared_statement(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void srepl_set_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sdk_vlabel(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int csect_finalize_static_critical_sections(void)
void sboot_notify_ha_log_applier_state(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define ER_NET_UNKNOWN_SERVER_REQ
Definition: error_code.h:264
void shf_has_instance(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool logtb_is_interrupted_tran(THREAD_ENTRY *thread_p, bool clear, bool *continue_checking, int tran_index)
void sserial_get_next_value(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sfile_apply_tde_to_class_files(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int sysprm_load_and_init(const char *db_name, const char *conf_file, const int load_flags)
void ssession_set_row_count(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogtb_reset_wait_msecs(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sct_check_rep_dir(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define IS_INVALID_SOCKET(socket)
Definition: porting.h:484
void sloaddb_load_batch(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool css_is_shutdowning_server()
void stran_server_abort(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool logtb_has_updated(THREAD_ENTRY *thread_p)
void sdk_freepgs(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_get_session_variable(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int total_size_sent
Definition: network_sr.c:77
void sqmgr_prepare_query(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void smnt_server_start_stats(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_find_number_temp_volumes(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqmgr_dump_query_cache(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void(* net_server_func)(THREAD_ENTRY *thrd, unsigned int rid, char *request, int reqlen)
Definition: network_sr.c:70
void slocator_fetch_all_reference_lockset(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void shf_create(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define NULL
Definition: freelistheap.h:34
const char * er_msg(void)
int logtb_invalidate_snapshot_data(THREAD_ENTRY *thread_p)
void sbtree_get_key_type(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sthread_dump_cs_stat(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void css_end_server_request(CSS_CONN_ENTRY *conn)
bool in_transaction
void smnt_server_copy_stats(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
static int net_Histo_call_count
Definition: network_sr.c:83
void slock_dump(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sloaddb_init(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void thread_lock_entry(cubthread::entry *thread_p)
int logtb_find_client_type(int tran_index)
void slogtb_set_suppress_repl_on_transaction(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_delete_prepared_statement(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sloaddb_interrupt(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int msgcat_init(void)
void shf_destroy_when_new(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_heap_compact(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define ER_NET_SERVER_SHUTDOWN
Definition: error_code.h:263
void sbtree_class_test_unique(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sjsp_get_server_port(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_rename_class_name(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void shf_destroy(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ses_posix_write_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
unsigned int css_send_abort_to_client(CSS_CONN_ENTRY *conn, unsigned int eid)
void ses_posix_rename_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define NULL_TRAN_INDEX
int action_attribute
Definition: network_sr.c:73
void slocator_find_class_oid(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
static void error(const char *msg)
Definition: gencat.c:331
void thread_unlock_entry(cubthread::entry *thread_p)
void sqp_get_sys_timestamp(THREAD_ENTRY *thread_p, unsigned int rid, char *request_ignore, int reqlen_ignore)
STATIC_INLINE void perfmon_inc_stat(THREAD_ENTRY *thread_p, PERF_STAT_ID psid) __attribute__((ALWAYS_INLINE))
int net_server_start(const char *server_name)
Definition: network_sr.c:1292
void stran_server_set_global_tran_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_find_number_permanent_volumes(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_end_topop(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define ARG_FILE_LINE
Definition: error_manager.h:44
#define ER_AU_DBA_ONLY
Definition: error_code.h:204
void sboot_change_ha_mode(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define ER_NET_NO_MASTER
Definition: error_code.h:267
void sboot_find_last_temp(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int css_windows_startup(void)
Definition: wintcp.c:94
void ssession_end_session(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_get_class(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sprm_server_change_parameters(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_find_lockhint_class_oids(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ses_posix_read_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogtb_reset_isolation(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_force(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define free_and_init(ptr)
Definition: memory_alloc.h:147
void stran_server_2pc_prepare_global_tran(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sdk_remarks(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool xboot_shutdown_server(REFPTR(THREAD_ENTRY, thread_p), ER_FINAL_CODE is_er_final)
Definition: boot_sr.c:3080
#define ER_NET_CANT_ALLOC_BUFFER
Definition: error_code.h:254
void slocator_assign_oid(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
char * css_pack_server_name(const char *server_name, int *name_length)
void ses_posix_get_file_size(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int csect_initialize_static_critical_sections(void)
void slogtb_get_pack_tran_table(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_stop_attached_threads(void *session)
void css_windows_shutdown(void)
Definition: wintcp.c:140
bool prm_get_bool_value(PARAM_ID prm_id)
void schksum_insert_repl_log_and_demote_table_lock(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogpb_dump_stat(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqmgr_prepare_and_execute_query(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogin_user(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void srepl_log_get_append_lsa(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
#define CHECK_MODIFICATION_NO_RETURN(error)
Definition: db.h:135
int i
Definition: dynamic_load.c:954
void sbtree_load_index(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_assign_oid_batch(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
bool logtb_am_i_dba_client(THREAD_ENTRY *thread_p)
void svacuum_dump(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_remove_class_from_index(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ses_posix_create_file(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slog_checkpoint(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_notify_isolation_incons(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stran_server_get_global_tran_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogtb_does_active_user_exist(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_check_fk_validity(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void stde_get_data_keys(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void initialize(entry *&my_entry)
void net_cleanup_server_queues(unsigned int rid)
Definition: network_sr.c:1430
void svacuum(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int invalidate_snapshot
void sqp_get_server_info(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_compact_stop(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void ssession_drop_session_variables(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void css_free_user_access_status(void)
int server_ping_with_handshake(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void finalize(void)
void sbtree_add_index(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void netsr_spacedb(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqmgr_drop_all_query_plans(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_initialize_server(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_get_timezone_checksum(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
net_server_func processing_function
Definition: network_sr.c:74
void sqst_update_all_statistics(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
net_server_request
Definition: network.h:44
TRAN_STATE return_error_to_client(THREAD_ENTRY *thread_p, unsigned int rid)
void stde_get_mk_file_path(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slocator_repl_force(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sqst_update_statistics(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int xboot_unregister_client(REFPTR(THREAD_ENTRY, thread_p), int tran_index)
Definition: boot_sr.c:3343
void sqst_server_get_statistics(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void slogwr_get_log_pages(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sacl_reload(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void css_cleanup_server_queues(unsigned int eid)
int client_id
void slocator_does_exist(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
void sboot_backup(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int sync_initialize_sync_stats(void)
void sloaddb_install_class(THREAD_ENTRY *thread_p, unsigned int rid, char *request, int reqlen)
int request_count
Definition: network_sr.c:76