30 #include <sys/types.h> 86 #if defined(SERVER_MODE) 97 #if defined(ENABLE_SYSTEMTAP) 101 #define BOOT_LEAVE_SAFE_OSDISK_PARTITION_FREE_SPACE \ 102 (1250 * (IO_DEFAULT_PAGE_SIZE / IO_PAGESIZE)) 104 #define BOOT_FORMAT_MAX_LENGTH 500 105 #define BOOTSR_MAX_LINE 500 139 const int lang_buf_size,
char *timezone_checksum);
150 #if defined(SERVER_MODE) 167 #if defined(SERVER_MODE) 168 static bool boot_Set_server_at_exit =
false;
169 static int boot_Server_process_id = 1;
183 int (*fun) (
THREAD_ENTRY * thread_p,
VOLID xvolid,
const char *vlabel,
void *args),
187 void *args),
void *args);
191 bool forward_dir,
bool check_before_access);
196 const char *db_comments,
DKNPAGES db_npages,
const char *file_addmore_vols,
197 const char *log_path,
const char *log_prefix,
DKNPAGES log_npages,
200 const char *log_prefix,
bool dirty_rem,
bool force_delete);
205 #if defined(CUBRID_DEBUG) 206 static void boot_check_db_at_num_shutdowns (
bool force_nshutdowns);
209 #if defined(SERVER_MODE) 210 static void boot_shutdown_server_at_exit (
void);
214 const char *log_prefix);
229 static const char *status_str[] = {
"UNKNOWN",
"UP",
"DOWN",
"MAINTENANCE" };
234 #if defined(SERVER_MODE) 235 if (boot_Set_server_at_exit ==
false)
237 boot_Set_server_at_exit =
true;
238 boot_Server_process_id = getpid ();
239 (void) atexit (boot_shutdown_server_at_exit);
245 #if defined(SERVER_MODE) 255 boot_shutdown_server_at_exit (
void)
260 boot_Server_process_id++;
275 boot_donot_shutdown_server_at_exit (
void)
279 boot_Server_process_id++;
302 recdes.
data = (
char *) dbparm;
347 nvols = boot_Db_parm->
nvols;
698 fp = fopen (filename_addmore_vols,
"r");
717 if (line[0] ==
'\0' || line[0] ==
'#')
723 if (line[ext_npages - 1] !=
'\n')
725 line[ext_npages] =
'\n';
726 line[ext_npages + 1] =
'\0';
779 if (token_value[0] ==
'"' || token_value[0] ==
'\'')
783 delim = token_value[0];
789 while (line[0] != delim);
807 ext_name = token_value;
811 ext_path = token_value;
815 ext_comments = token_value;
845 if (sscanf (token_value,
"%i", (
int *) &ext_npages) != 1)
851 else if (ext_npages <= 0)
866 if (error_code !=
NO_ERROR || (ext_name ==
NULL && ext_path ==
NULL && ext_comments ==
NULL && ext_npages == 0))
961 const char *temp_path;
962 const char *temp_name;
963 char *alloc_tempath =
NULL;
967 temp_vol_fullname[0] =
'\0';
970 if (alloc_tempath ==
NULL)
975 if (temp_path ==
NULL || temp_path[0] ==
'\0')
998 char temp_vol_fullname[PATH_MAX];
1009 for (; temp_volid > boot_Db_parm->
last_volid; temp_volid--)
1035 int (*fun) (
THREAD_ENTRY * thread_p,
VOLID xvolid,
const char *vlabel,
void *args),
void *args)
1077 int (*fun) (
THREAD_ENTRY * thread_p,
VOLID xvolid,
const char *vlabel,
void *args),
1083 if (newvolpath || !use_volinfo
1088 char next_vol_fullname[PATH_MAX];
1101 if (next_volid != volid)
1103 error_code = (*fun) (thread_p, next_volid, next_vol_fullname, args);
1110 if (
disk_get_link (thread_p, next_volid, &next_volid, next_vol_fullname) ==
NULL)
1116 if (use_volinfo ==
true)
1130 if (num_vols != boot_Db_parm->
nvols)
1137 boot_Db_parm->
nvols);
1146 if (num_vols < boot_Db_parm->
nvols)
1167 bool forward_dir,
bool check_before_access)
1170 char temp_vol_fullname[PATH_MAX];
1171 const char *temp_path;
1172 const char *temp_name;
1173 char *alloc_tempath =
NULL;
1183 if (alloc_tempath ==
NULL)
1188 if (temp_path ==
NULL || temp_path[0] ==
'\0')
1201 temp_volid = (
VOLID) num_vols;
1202 if (temp_volid != volid)
1206 go_to_access =
false;
1207 if (check_before_access)
1211 go_to_access =
true;
1216 go_to_access =
true;
1220 (void) (*fun) (thread_p, temp_volid, temp_vol_fullname);
1229 temp_volid = (
VOLID) num_vols;
1230 if (temp_volid != volid)
1234 go_to_access =
false;
1235 if (check_before_access)
1239 go_to_access =
true;
1244 go_to_access =
true;
1248 (void) (*fun) (thread_p, temp_volid, temp_vol_fullname);
1275 char next_vol_fullname[PATH_MAX];
1321 if (num_vols != boot_Db_parm->
nvols)
1324 boot_Db_parm->
nvols);
1343 char check_vlabel[PATH_MAX];
1378 #if !defined(WINDOWS) 1392 #if !defined(WINDOWS) 1393 _longjmp (boot_Init_server_jmpbuf, 1);
1395 boot_Init_server_is_canceled =
true;
1463 bool db_overwrite,
const char *file_addmore_vols,
volatile DKNPAGES db_npages,
1469 const char *log_prefix =
NULL;
1473 char db_pathbuf[PATH_MAX];
1474 char vol_real_path[PATH_MAX];
1475 char log_pathbuf[PATH_MAX];
1477 char dbtxt_label[PATH_MAX];
1478 char fixed_pathbuf[PATH_MAX];
1479 char original_namebuf[PATH_MAX];
1480 #if defined (NDEBUG) 1484 void (*old_ctrl_c_handler) (
int sig_no) = SIG_ERR;
1485 struct stat stat_buf;
1486 bool is_exist_volume;
1487 const char *db_path, *log_path, *lob_path;
1494 #if defined(SERVER_MODE) 1552 #if defined(CUBRID_DEBUG) 1557 "xboot_initialize_server: ** SYSTEM COMPILATION ERROR **" 1558 " Length (i.e., %d) of ROOTCLASS_NAME(i.e, %s) is bigger than" 1566 if (client_credential->
db_name.empty ())
1577 memset (db_pathbuf, 0,
sizeof (db_pathbuf));
1578 memset (log_pathbuf, 0,
sizeof (log_pathbuf));
1579 memset (lob_pathbuf, 0,
sizeof (lob_pathbuf));
1585 db_path = db_path_info->
db_path;
1586 if (realpath (db_path, fixed_pathbuf) !=
NULL)
1588 db_path = fixed_pathbuf;
1596 db_path = db_pathbuf;
1603 if (realpath (log_path, fixed_pathbuf) !=
NULL)
1605 log_path = fixed_pathbuf;
1622 p = strchr (lob_pathbuf,
':') + 1;
1626 p = strchr (strcpy (lob_pathbuf, lob_path),
':') + 1;
1630 if (lob_path ==
NULL)
1638 #if defined (WINDOWS) 1639 if (realpath (lob_path, fixed_pathbuf) !=
NULL 1640 && (stat (fixed_pathbuf, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode)))
1642 if (realpath (lob_path, fixed_pathbuf) !=
NULL)
1645 lob_path = fixed_pathbuf;
1650 if (mkdir (lob_path, 0777) < 0)
1674 #if defined(SERVER_MODE) 1682 if (thread_p ==
NULL)
1703 if (log_npages <= 0)
1708 if (log_npages < 10)
1728 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
1754 if (db_overwrite ==
false)
1771 memset (original_namebuf, 0,
sizeof (original_namebuf));
1795 if (error_code !=
NO_ERROR || is_exist_volume)
1800 #if !defined(WINDOWS) 1803 if (realpath ((
char *) db_path_info->
vol_path, vol_real_path) ==
NULL)
1810 if (stat (vol_real_path, &stat_buf) != 0
1811 || S_ISDIR (stat_buf.st_mode))
1838 #if !defined(WINDOWS) 1839 boot_Init_server_is_canceled = (_setjmp (boot_Init_server_jmpbuf) != 0);
1842 if (!boot_Init_server_is_canceled)
1846 log_pathbuf, (
const char *) log_prefix, log_npages, client_lock_wait,
1851 #if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 1894 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 1928 if (boot_Init_server_is_canceled)
1957 #if defined (NDEBUG) 1966 if (old_ctrl_c_handler != SIG_ERR)
1975 if (old_ctrl_c_handler != SIG_ERR)
2012 unsigned char ip[4];
2014 t = (UINT32) time (
NULL);
2049 char log_path[PATH_MAX];
2050 const char *log_prefix;
2053 #if defined (NDEBUG) 2058 char dbtxt_label[PATH_MAX];
2059 #if defined(SERVER_MODE) 2067 char timezone_checksum[32 + 1];
2102 #if defined(SERVER_MODE) 2113 if (db_name ==
NULL)
2153 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
2201 strcpy (log_path, db->
logpath);
2217 #if defined(SERVER_MODE) 2295 #if defined (SA_MODE) 2346 if (from_backup !=
false)
2351 #if defined(SA_MODE) 2418 snprintf (er_msg,
sizeof (er_msg) - 1,
2419 "Cannot find a valid charset in log header or first volume header or different values have " 2495 #if defined(SERVER_MODE) 2496 pgbuf_daemons_init ();
2497 dwb_daemons_init ();
2563 if (db_charset_db_header != db_charset_db_root)
2566 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid charset in db_root system table: expecting %s, found %s",
2592 #if defined (SERVER_MODE) 2596 error_code = serial_cache_index_btid (thread_p);
2677 if (db_collations != NULL)
2684 if (db_collations != NULL)
2695 #if defined (SA_MODE) 2721 #if defined (SERVER_MODE) 2732 #if defined (SERVER_MODE) 2751 #if defined (NDEBUG) 2754 fprintf (stdout, format,
rel_name ());
2761 if (from_backup ==
true)
2773 #if !defined(SA_MODE) 2774 json_set_alloc_funcs (malloc, free);
2785 prev_err_msg = (
char *)
er_msg ();
2786 if (prev_err_msg != NULL)
2788 prev_err_msg =
strdup (prev_err_msg);
2808 #if defined(SERVER_MODE) 2809 pgbuf_daemons_destroy ();
2810 dwb_daemons_destroy ();
2818 #if defined(SERVER_MODE) 2826 #if defined (SA_MODE) 2852 CHECK_ARGS check_coll_and_timezone = {
true,
true };
2944 char mk_path[PATH_MAX] = { 0, };
2945 char mk_path_old[PATH_MAX] = { 0, };
2948 time_t created_time;
2956 if (thread_p ==
NULL)
2973 err =
tde_load_mk (server_mk_vdes, &keyinfo, master_key);
3022 strcpy (mk_path_old, mk_path);
3023 strcat (mk_path_old,
"_old");
3038 err =
tde_change_mk (thread_p, mk_index, master_key, created_time);
3087 #if defined(CUBRID_DEBUG) 3088 boot_check_db_at_num_shutdowns (
true);
3115 #if defined(SERVER_MODE) 3116 pgbuf_daemons_destroy ();
3119 #if defined (SA_MODE) 3138 #if defined (SA_MODE) 3185 std::string db_user_save;
3187 bool skip_vacuum =
false;
3188 #if defined(SA_MODE) 3189 std::string adm_prg_file_name;
3190 CHECK_ARGS check_coll_and_timezone = {
true,
true };
3194 #if defined(SA_MODE) 3201 adm_prg_file_name = client_credential->
program_name.substr (sep_index + 1);
3208 if (!adm_prg_file_name.empty ())
3210 if (strncasecmp (adm_prg_file_name.c_str (),
"synccolldb",
strlen (
"synccolldb")) == 0
3211 || strncasecmp (adm_prg_file_name.c_str (),
"migrate_",
strlen (
"migrate_")) == 0)
3215 if (strncasecmp (adm_prg_file_name.c_str (),
"gen_tz",
strlen (
"gen_tz")) == 0)
3248 if (!client_credential->
db_user.empty ())
3251 client_credential->
db_user = db_user_upper;
3258 #if defined (SERVER_MODE) 3259 if (thread_p->conn_entry->status !=
CONN_OPEN)
3269 #if defined (SERVER_MODE) 3270 thread_p->conn_entry->set_tran_index (tran_index);
3287 #if defined (SERVER_MODE) 3296 #if defined(SERVER_MODE) 3305 client_credential->
db_user = db_user_save;
3320 #if defined(ENABLE_SYSTEMTAP) && defined(SERVER_MODE) 3321 CUBRID_CONN_START (thread_p->conn_entry->client_id, client_credential->
get_db_user ());
3324 client_credential->
db_user = db_user_save;
3347 #if defined(SERVER_MODE) 3358 #if defined(SERVER_MODE) 3359 conn = thread_p->conn_entry;
3363 thread_p->tran_index = save_index;
3365 #if defined(ENABLE_SYSTEMTAP) 3366 CUBRID_CONN_END (-1,
"NULL");
3388 #if defined(ENABLE_SYSTEMTAP) 3389 CUBRID_CONN_END (-1,
"NULL");
3402 perfmon_stop_watch (thread_p);
3404 #if defined(ENABLE_SYSTEMTAP) && defined(SERVER_MODE) 3414 #if defined(CUBRID_DEBUG) 3415 boot_check_db_at_num_shutdowns (
false);
3418 #if defined(SA_MODE) 3425 #if defined(SERVER_MODE) 3436 xboot_notify_unregister_client (
THREAD_ENTRY * thread_p,
int tran_index)
3442 conn = thread_p->conn_entry;
3460 #if defined(CUBRID_DEBUG) 3484 boot_check_db_at_num_shutdowns (
bool force_nshutdowns)
3486 const char *env_value;
3487 const char *checkdb_file_num_shutdowns =
".checkdb_num_shutdowns";
3489 static int checkdb_every_nshutdowns = -1;
3490 static int num_current_shutdowns = -1;
3492 if (force_nshutdowns ==
true)
3494 if (checkdb_every_nshutdowns > 0 && (fp = fopen (checkdb_file_num_shutdowns,
"w")) !=
NULL)
3496 fprintf (fp,
"%d", num_current_shutdowns);
3506 if (checkdb_every_nshutdowns == -1)
3508 env_value =
envvar_get (
"CHECKDB_EVERY_NSHUTDOWNS");
3509 if (env_value !=
NULL)
3511 checkdb_every_nshutdowns = atoi (env_value);
3515 checkdb_every_nshutdowns = 0;
3518 if (checkdb_every_nshutdowns <= 0)
3520 checkdb_every_nshutdowns = 0;
3521 (void)
remove (checkdb_file_num_shutdowns);
3525 fp = fopen (checkdb_file_num_shutdowns,
"r");
3528 if (fscanf (fp,
"%d", &num_current_shutdowns) != 1)
3530 num_current_shutdowns = 0;
3535 num_current_shutdowns = 0;
3539 if (checkdb_every_nshutdowns > 0)
3541 num_current_shutdowns++;
3543 if (num_current_shutdowns == checkdb_every_nshutdowns)
3545 num_current_shutdowns = 0;
3548 const char *tmpname;
3552 if (tmpname ==
NULL)
3554 tmpname =
"/dev/null";
3557 "Some inconsistencies were detected in your database.\n Please consult error_log file = %s" 3558 " for additional information\n", tmpname);
3629 if (index_btid ==
NULL)
3695 #if defined (SA_MODE) 3699 fprintf (stdout, print_str);
3737 for (i = 0; i < num_oids; i++)
3886 #if defined(SERVER_MODE) 3908 #if defined(SERVER_MODE) 3940 bool delete_unneeded_logarchives,
const char *backup_verbose_file,
int num_threads,
3947 logpb_backup (thread_p, boot_Db_parm->
nvols, backup_path, backup_level, delete_unneeded_logarchives,
3948 backup_verbose_file, num_threads, zip_method, zip_level, skip_activelog, sleep_msecs, separate_keys);
3976 const char *new_log_path,
const char *new_lob_path,
const char *new_db_server_host,
3977 const char *new_volext_path,
const char *fileof_vols_and_copypaths,
bool new_db_overwrite)
3981 const char *new_log_prefix;
3982 char new_db_fullname[PATH_MAX];
3983 char new_db_pathbuf[PATH_MAX];
3984 char new_db_pathbuf2[PATH_MAX];
3985 char new_log_pathbuf[PATH_MAX];
3986 char new_lob_pathbuf2[PATH_MAX];
3987 char new_lob_pathbuf[PATH_MAX];
3988 char new_volext_pathbuf[PATH_MAX];
3989 char fixed_pathbuf[PATH_MAX];
3991 char dbtxt_label[PATH_MAX];
3994 #if defined (WINDOWS) 3995 struct stat stat_buf;
4002 if (new_db_path ==
NULL || fileof_vols_and_copypaths !=
NULL)
4009 if (new_db_path ==
NULL)
4021 if (new_db_path ==
NULL)
4025 else if (realpath ((
char *) new_db_path, new_db_pathbuf2) !=
NULL)
4027 new_db_path = new_db_pathbuf2;
4030 if (new_log_path !=
NULL && realpath ((
char *) new_log_path, new_log_pathbuf) !=
NULL)
4032 new_log_path = new_log_pathbuf;
4035 if (new_log_path ==
NULL)
4038 strcpy (new_log_pathbuf, new_db_path);
4039 new_log_path = new_log_pathbuf;
4042 if (new_lob_path ==
NULL)
4045 if (snprintf (new_lob_pathbuf2,
sizeof (new_lob_pathbuf2),
"%s%s/lob",
LOB_PATH_DEFAULT_PREFIX, new_db_path) < 0)
4049 new_lob_path = new_lob_pathbuf2;
4052 if (new_lob_path !=
NULL)
4065 new_lob_path = new_lob_pathbuf;
4067 p = (
char *) strchr (new_lob_path,
':') + 1;
4070 p = strchr (strcpy (new_lob_pathbuf, new_lob_path),
':') + 1;
4073 #if !defined (CUBRID_OWFS) 4085 #if defined (WINDOWS) 4086 if (realpath (p, fixed_pathbuf) !=
NULL 4087 && (stat (fixed_pathbuf, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode)))
4089 if (realpath (p, fixed_pathbuf) !=
NULL)
4092 strcpy (p, fixed_pathbuf);
4097 if (mkdir (p, 0777) < 0)
4108 if (new_volext_path !=
NULL && realpath ((
char *) new_volext_path, new_volext_pathbuf) !=
NULL)
4110 new_volext_path = new_volext_pathbuf;
4115 if (new_db_server_host ==
NULL)
4127 strcpy (new_db_server_host_buf,
"localhost");
4129 new_db_server_host = new_db_server_host_buf;
4151 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
4180 if (new_db_overwrite ==
false)
4196 CHECK_ARGS check_col_and_timezone = {
true,
true };
4222 xboot_copy (thread_p, from_dbname, new_db_name, new_db_path, new_log_path, new_lob_path, new_db_server_host,
4223 new_volext_path, fileof_vols_and_copypaths,
false);
4242 COMPOSE_FULL_NAME (new_db_fullname,
sizeof (new_db_fullname), new_db_path, new_db_name);
4249 logpb_copy_database (thread_p, boot_Db_parm->
nvols, new_db_fullname, new_log_path, new_log_prefix, new_volext_path,
4250 fileof_vols_and_copypaths);
4265 #if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4294 db =
cfg_add_db (&dir, new_db_name, new_db_path, new_log_path, new_lob_path, new_db_server_host);
4312 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4382 const char *new_log_path,
const char *new_db_server_host,
const char *new_volext_path,
4383 const char *fileof_vols_and_renamepaths,
bool new_db_overwrite,
bool extern_rename,
4388 const char *newlog_prefix;
4390 char new_db_fullname[PATH_MAX];
4391 char new_db_pathbuf[PATH_MAX];
4392 char new_log_pathbuf[PATH_MAX];
4394 char dbtxt_label[PATH_MAX];
4395 char allocdb_path[PATH_MAX];
4396 char alloclog_path[PATH_MAX];
4399 if (fileof_vols_and_renamepaths !=
NULL)
4406 if (new_db_path ==
NULL)
4413 if (new_db_path ==
NULL)
4419 if (new_db_path ==
NULL)
4421 if (getcwd (allocdb_path, PATH_MAX) ==
NULL)
4427 new_db_path = allocdb_path;
4431 if (new_log_path ==
NULL)
4437 if (new_log_path ==
NULL)
4439 if (getcwd (alloclog_path, PATH_MAX) ==
NULL)
4445 new_log_path = alloclog_path;
4454 if (realpath ((
char *) new_db_path, new_db_pathbuf) !=
NULL)
4456 new_db_path = new_db_pathbuf;
4459 if (new_log_path !=
NULL && realpath ((
char *) new_log_path, new_log_pathbuf) !=
NULL)
4461 new_log_path = new_log_pathbuf;
4466 if (new_log_path ==
NULL)
4469 strncpy (new_log_pathbuf, new_db_path, PATH_MAX);
4470 new_log_path = new_log_pathbuf;
4475 if (new_db_server_host ==
NULL)
4487 strcpy (new_db_server_host_buf,
"localhost");
4489 new_db_server_host = new_db_server_host_buf;
4511 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
4545 if (dir !=
NULL && db !=
NULL && extern_rename ==
true && new_db_overwrite ==
false)
4557 COMPOSE_FULL_NAME (new_db_fullname,
sizeof (new_db_fullname), new_db_path, new_db_name);
4565 new_volext_path, fileof_vols_and_renamepaths, extern_rename, force_delete);
4572 if (extern_rename ==
true)
4576 const char *old_lob_path =
NULL;
4577 char new_lob_pathbuf[PATH_MAX] = {
'\0' };
4578 char *new_lob_path =
NULL;
4581 if (*old_lob_path !=
'\0')
4587 db =
cfg_add_db (&dir, new_db_name, new_db_path, new_log_path, new_lob_path, new_db_server_host);
4600 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4655 char log_path[PATH_MAX];
4656 const char *log_prefix =
NULL;
4660 char dbtxt_label[PATH_MAX];
4709 goto error_dirty_delete;
4712 #if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4754 goto error_dirty_delete;
4772 strcpy (log_path, db->
logpath);
4787 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4791 goto error_dirty_delete;
4799 goto error_dirty_delete;
4806 goto error_dirty_delete;
4814 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 4847 #if defined (SERVER_MODE) 4855 #if defined (SA_MODE) 4868 #if defined (SERVER_MODE) 4875 #if defined (SA_MODE) 4903 const char *db_comments,
DKNPAGES db_npages,
const char *file_addmore_vols,
4904 const char *log_path,
const char *log_prefix,
DKNPAGES log_npages,
4925 if (error_code !=
NO_ERROR || boot_Init_server_is_canceled)
4985 boot_Db_parm->
nvols = 1;
5077 recdes.
data = (
char *) boot_Db_parm;
5113 if (file_addmore_vols !=
NULL)
5211 bool dirty_rem,
bool force_delete)
5217 goto error_rem_allvols;
5258 goto error_rem_allvols;
5262 goto error_rem_allvols;
5266 goto error_rem_allvols;
5271 goto error_rem_allvols;
5275 goto error_rem_allvols;
5280 goto error_rem_allvols;
5285 goto error_rem_allvols;
5292 goto error_rem_allvols;
5297 goto error_rem_allvols;
5309 error_code =
logpb_delete (thread_p, boot_Db_parm->
nvols, db_fullname, log_path, log_prefix, force_delete);
5314 error_code =
logpb_delete (thread_p, -1, db_fullname, log_path, log_prefix, force_delete);
5338 char log_path[PATH_MAX];
5339 const char *log_prefix;
5343 char dbtxt_label[PATH_MAX];
5347 char dummy_timezone_checksum[32 + 1];
5369 if (db_name ==
NULL)
5409 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
5449 strcpy (log_path, db->
logpath);
5472 if (recreate_log != 0)
5516 if (recreate_log ==
false)
5522 snprintf (er_msg,
sizeof (er_msg) - 1,
5523 "Cannot found a valid charset in volumes header or there is a missmatch.");
5589 if (recreate_log ==
false)
5612 dummy_timezone_checksum);
5618 if (db_charset_db_header != db_charset_db_root)
5621 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid charset in db_root system table: expecting %s, found %s",
5628 if (recreate_log ==
true)
5630 if (log_npages <= 0)
5635 if (log_npages < 10)
5684 FILE *where_paths_fp;
5685 char from_volname[PATH_MAX];
5688 char format_string[32];
5689 #if !defined(WINDOWS) 5690 struct stat stat_buf;
5693 if (fileof_vols_and_wherepaths !=
NULL)
5698 where_paths_fp = fopen (fileof_vols_and_wherepaths,
"r");
5699 if (where_paths_fp ==
NULL)
5702 fileof_vols_and_wherepaths);
5707 *from_volname =
'\0';
5709 sprintf (format_string,
"%%d %%%ds %%%ds", PATH_MAX - 1, PATH_MAX - 1);
5710 if (fscanf (where_paths_fp, format_string, &from_volid, from_volname, db_pathbuf) != 3
5713 fclose (where_paths_fp);
5718 fclose (where_paths_fp);
5720 #if !defined(WINDOWS) 5721 if (stat (db_pathbuf, &stat_buf) != -1 && S_ISCHR (stat_buf.st_mode))
5723 if (getcwd (db_pathbuf, PATH_MAX) ==
NULL)
5735 #if defined(WINDOWS) 5737 char *name_tmp = strrchr (db_pathbuf,
'/');
5739 if (name < name_tmp)
5748 if (getcwd (db_pathbuf, PATH_MAX) ==
NULL)
5763 if (getcwd (db_pathbuf, PATH_MAX) ==
NULL)
5788 FILE *volinfo_fp =
NULL;
5789 char format_string[32];
5792 volinfo_fp = fopen (log_path,
"r");
5793 if (volinfo_fp ==
NULL)
5799 sprintf (format_string,
"%%d %%%ds", PATH_MAX - 1);
5802 if (fscanf (volinfo_fp, format_string, &read_int_volid, log_path) != 2)
5812 fclose (volinfo_fp);
5817 #if defined(WINDOWS) 5819 char *r_slash = strrchr (log_path,
'/');
5821 if (slash < r_slash)
5861 int instance_lock_timeout,
int class_lock_timeout,
bool delete_old_repr,
5863 int *modified_objects,
int *big_objects,
int *initial_last_repr_id)
5865 return boot_compact_db (thread_p, class_oids, n_classes, space_to_process, instance_lock_timeout, class_lock_timeout,
5866 delete_old_repr, last_processed_class_oid, last_processed_oid, total_objects, failed_objects,
5867 modified_objects, big_objects, initial_last_repr_id);
5923 log_header_db_charset =
5933 return vol_header_db_charset;
5937 return log_header_db_charset;
5939 else if (vol_header_db_charset != log_header_db_charset)
5944 assert (vol_header_db_charset == log_header_db_charset);
5946 return vol_header_db_charset;
5955 return "SYSTEM_INTERNAL";
5961 return "READ_ONLY_CSQL";
5965 return "READ_ONLY_BROKER";
5967 return "SLAVE_ONLY_BROKER";
5969 return "ADMIN_UTILITY";
5971 return "ADMIN_CSQL";
5973 return "LOG_COPIER";
5975 return "LOG_APPLIER";
5977 return "RW_BROKER_REPLICA_ONLY";
5979 return "RO_BROKER_REPLICA_ONLY";
5981 return "SO_BROKER_REPLICA_ONLY";
5983 return "ADMIN_CSQL_WOS";
5985 return "SKIP_VACUUM_CSQL";
5987 return "SKIP_VACUUM_ADMIN_CSQL";
5996 const char *given_name,
char *fullname_newvol_out,
VOLID * volid_newvol_out)
5998 char buf_temp_path[PATH_MAX];
5999 const char *temp_path =
NULL;
6000 const char *temp_name =
NULL;
6004 *volid_newvol_out = boot_Db_parm->
last_volid + 1;
6014 if (given_path !=
NULL)
6016 temp_path = given_path;
6021 if (temp_path ==
NULL)
6024 if (temp_path ==
NULL)
6026 buf_temp_path[0] =
'\0';
6027 temp_path = buf_temp_path;
6032 if (given_name !=
NULL)
6034 temp_name = given_name;
6047 if (*volid_newvol_out <= boot_Db_parm->
last_volid)
6057 if (temp_path ==
NULL || temp_path[0] ==
'\0')
6071 VPID vpid_boot_bp_parm;
6088 boot_Db_parm->
nvols++;
6112 *boot_Db_parm = save_boot_db_parm;
6141 recdes.
data = (
char *) boot_Db_parm;
int css_free_accessible_ip_info(void)
int lang_set_charset(const INTL_CODESET codeset)
#define ER_LOG_USER_FILE_UNKNOWN
void fileio_make_volume_ext_name(char *vol_ext_full_name_p, const char *ext_path_p, const char *ext_name_p, VOLID vol_id)
int xboot_heap_compact(THREAD_ENTRY *thread_p, OID *class_oid)
int xboot_compact_stop(THREAD_ENTRY *thread_p)
char * cfg_maycreate_get_directory_filename(char *buffer)
int lang_set_language(const char *lang_str)
void log_initialize(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname, int ismedia_crash, BO_RESTART_ARG *r_args)
DISK_ISVALID xboot_checkdb_table(THREAD_ENTRY *thread_p, int check_flag, OID *oid, BTID *index_btid)
cubthread::entry * thread_get_thread_entry_info(void)
static void boot_find_rest_temp_volumes(THREAD_ENTRY *thread_p, VOLID volid, int(*fun)(THREAD_ENTRY *thread_p, VOLID xvolid, const char *vlabel), bool forward_dir, bool check_before_access)
int check_timezone_compat(const char *client_checksum, const char *server_checksum, const char *client_text, const char *server_text)
int boot_heap_compact_pages(THREAD_ENTRY *thread_p, OID *class_oid)
void fileio_unformat_and_rename(THREAD_ENTRY *thread_p, const char *vol_label_p, const char *new_label_p)
int pr_Enable_string_compression
void session_states_finalize(THREAD_ENTRY *thread_p)
void thread_return_lock_free_transaction_entries(void)
VOLID xboot_find_last_permanent(THREAD_ENTRY *thread_p)
void logtb_disable_update(THREAD_ENTRY *thread_p)
#define ER_TDE_RESTORE_MAKE_KEYS_FILE_OLD
VOLID xboot_peek_last_permanent(THREAD_ENTRY *thread_p)
#define BO_IS_SERVER_RESTARTED()
PGLENGTH log_get_io_page_size(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
static int boot_check_permanent_volumes(THREAD_ENTRY *thread_p)
#define ER_TDE_RESTORE_KEY_FOUND_ONLY_FROM_BACKUP
int boot_compact_stop(THREAD_ENTRY *thread_p)
#define HA_CHANGE_MODE_IMMEDIATELY
VOLID xboot_add_volume_extension(THREAD_ENTRY *thread_p, DBDEF_VOL_EXT_INFO *ext_info)
float rel_disk_compatible(void)
int sysprm_set_force(const char *pname, const char *pvalue)
int vacuum_reset_data_after_copydb(THREAD_ENTRY *thread_p)
void showstmt_scan_init(void)
int heap_scancache_start_modify(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int op_type, MVCC_SNAPSHOT *mvcc_snapshot)
static int boot_get_db_parm(THREAD_ENTRY *thread_p, BOOT_DB_PARM *dbparm, OID *dbparm_oid)
const char * boot_client_type_to_string(BOOT_CLIENT_TYPE type)
static char * boot_find_new_db_path(char *db_pathbuf, const char *fileof_vols_and_wherepaths)
int css_hostname_to_ip(const char *host, unsigned char *ip_addr)
int boot_reset_db_parm(THREAD_ENTRY *thread_p)
int xboot_unregister_client(REFPTR(THREAD_ENTRY, thread_p), int tran_index)
enum db_client_type BOOT_CLIENT_TYPE
bool logpb_find_volume_info_exist(void)
void logtb_release_tran_index(THREAD_ENTRY *thread_p, int tran_index)
void vacuum_stop_master(THREAD_ENTRY *thread_p)
#define ER_TDE_RESTORE_COPY_KEYS_FILE
#define ER_ES_INVALID_PATH
#define ER_BO_INCONSISTENT_NPERM_VOLUMES
int heap_manager_finalize(void)
const char * boot_get_lob_path(void)
int vacuum_log_block_npages
int file_tracker_load(THREAD_ENTRY *thread_p, const VFID *vfid)
int logpb_remove_all_in_log_path(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
const TZ_DATA * tz_get_data(void)
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)
const char * boot_db_name(void)
static void boot_ctrl_c_in_init_server(int ignore_signo)
static OID * boot_Db_parm_oid
int dwb_load_and_recover_pages(THREAD_ENTRY *thread_p, const char *dwb_path_p, const char *db_name_p)
int catcls_finalize_class_oid_to_oid_hash_table(THREAD_ENTRY *thread_p)
int rel_bit_platform(void)
void css_final_conn_list(void)
#define TRAN_DEFAULT_ISOLATION_LEVEL()
void fileio_unformat(THREAD_ENTRY *thread_p, const char *vol_label_p)
void boot_client_all_finalize(bool is_er_final)
void logpb_force_flush_pages(THREAD_ENTRY *thread_p)
#define ER_BO_PARSE_ADDVOLS_NOGIVEN_NPAGES
int css_change_ha_server_state(THREAD_ENTRY *thread_p, HA_SERVER_STATE state, bool force, int timeout, bool heartbeat)
void logtb_set_to_system_tran_index(THREAD_ENTRY *thread_p)
#define MSGCAT_GENERAL_DATABASE_INIT
#define ASSERT_ERROR_AND_SET(error_code)
#define ER_BO_PARSE_ADDVOLS_UNKNOWN_PURPOSE
static int boot_after_copydb(THREAD_ENTRY *thread_p)
#define assert_release(e)
#define ER_BO_CANT_LOAD_SYSPRM
const char * get_host_name() const
VOLID logpb_add_volume(const char *db_fullname, VOLID new_volid, const char *new_volfullname, DISK_VOLPURPOSE new_volpurpose)
void log_append_undo_data2(THREAD_ENTRY *thread_p, LOG_RCVINDEX rcvindex, const VFID *vfid, PAGE_PTR pgptr, PGLENGTH offset, int length, const void *data)
void locator_free_areas(void)
int lock_object(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, int cond_flag)
char log_Name_active[PATH_MAX]
static BOOT_DB_PARM boot_Struct_db_parm
#define ER_IO_MOUNT_LOCKED
int tde_initialize(THREAD_ENTRY *thread_p, HFID *keyinfo_hfid)
const VOLID LOG_DBLOG_ACTIVE_VOLID
void cfg_update_db(DB_INFO *db_info_p, const char *path, const char *logpath, const char *lobpath, const char *host)
int heap_scancache_quick_start_root_hfid(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
void catalog_initialize(CTID *catalog_id_p)
int xboot_find_number_permanent_volumes(THREAD_ENTRY *thread_p)
#define ER_BO_FULL_DATABASE_NAME_IS_TOO_LONG
TRAN_STATE xtran_server_commit(THREAD_ENTRY *thrd, bool retain_lock)
#define OID_SET_NULL(oidp)
int log_get_charset_from_header_page(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
static void boot_make_temp_volume_fullname(char *temp_vol_fullname, VOLID temp_volid)
void logtb_define_trantable(THREAD_ENTRY *thread_p, int num_expected_tran_indices, int num_expected_locks)
bool fileio_is_volume_exist(const char *vol_label_p)
LOG_TDES * LOG_FIND_TDES(int tran_index)
int dwb_create(THREAD_ENTRY *thread_p, const char *dwb_path_p, const char *db_name_p)
#define ER_BO_PARSE_ADDVOLS_BAD_NPAGES
const VOLID LOG_MAX_DBVOLID
static int boot_mount(THREAD_ENTRY *thread_p, VOLID volid, const char *vlabel, void *ignore_arg)
DISK_ISVALID locator_check_by_class_oid(THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, BTID *index_btid, bool repair)
DISK_ISVALID btree_check_by_class_oid(THREAD_ENTRY *thread_p, OID *cls_oid, BTID *idx_btid)
int xboot_restart_from_backup(THREAD_ENTRY *thread_p, int print_restart, const char *db_name, BO_RESTART_ARG *r_args)
#define ER_BO_NOT_A_VOLUME
TRAN_STATE xtran_server_abort(THREAD_ENTRY *thrd)
void oid_set_root(const OID *oid)
int disk_format_first_volume(THREAD_ENTRY *thread_p, const char *full_dbname, const char *dbcomments, DKNPAGES npages)
const VOLID LOG_DBTXT_VOLID
#define ER_FILE_UNKNOWN_VOLID
#define er_log_debug(...)
#define DATABASES_FILENAME
#define ER_BO_CANNOT_CREATE_LINK
enum remove_temp_vol_action REMOVE_TEMP_VOL_ACTION
static INTL_CODESET boot_get_db_charset_from_header(THREAD_ENTRY *thread_p, const char *log_path, const char *log_prefix)
int heap_scancache_end(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
#define ER_BO_CLIENT_CONNECTED
int xboot_emergency_patch(const char *db_name, bool recreate_log, DKNPAGES log_npages, const char *db_locale, FILE *out_fp)
char * fileio_get_directory_path(char *path_p, const char *full_name_p)
#define pgbuf_invalidate_all(thread_p, volid)
BOOT_SERVER_STATUS boot_Server_status
static int boot_generate_tde_keys(THREAD_ENTRY *thread_p)
int er_init(const char *msglog_filename, int exit_ask)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
const char * rel_build_number(void)
int logpb_scan_volume_info(THREAD_ENTRY *thread_p, const char *db_fullname, VOLID ignore_volid, VOLID start_volid, int(*fun)(THREAD_ENTRY *thread_p, VOLID xvolid, const char *vlabel, void *args), void *args)
VOLID xboot_find_last_temp(THREAD_ENTRY *thread_p)
int fileio_mount(THREAD_ENTRY *thread_p, const char *db_full_name_p, const char *vol_label_p, VOLID vol_id, int lock_wait, bool is_do_sync)
int vacuum_create_file_for_dropped_files(THREAD_ENTRY *thread_p, VFID *dropped_files_vfid)
const char * er_get_msglog_filename(void)
#define LOB_PATH_PREFIX_MAX
int boot_reset_mk_after_restart_from_backup(THREAD_ENTRY *thread_p, BO_RESTART_ARG *r_args)
void css_set_ha_num_of_hosts(int num)
void lf_destroy_transaction_systems(void)
#define ER_BO_CANNOT_CREATE_VOL
int disk_add_volume_extension(THREAD_ENTRY *thread_p, DB_VOLPURPOSE purpose, DKNPAGES npages, const char *path, const char *name, const char *comments, int max_write_size_in_sec, bool overwrite, VOLID *volid_out)
void logpb_force_flush_header_and_pages(THREAD_ENTRY *thread_p)
char server_session_key[SERVER_SESSION_KEY_SIZE]
void spage_finalize(THREAD_ENTRY *thread_p)
int heap_cache_class_info(THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid, FILE_TYPE ftype, const char *classname_in)
char boot_Host_name[CUB_MAXHOSTNAMELEN]
#define ER_BO_PARSE_ADDVOLS_UNKNOWN_TOKEN
int css_set_accessible_ip_info(void)
UINT64 prm_get_bigint_value(PARAM_ID prm_id)
const char * rel_build_type(void)
INTL_CODESET lang_charset(void)
STATIC_INLINE int boot_db_parm_update_heap(THREAD_ENTRY *thread_p) __attribute__((ALWAYS_INLINE))
int boot_find_root_heap(HFID *root_hfid_p)
int catcls_compile_catalog_classes(THREAD_ENTRY *thread_p)
#define ER_BO_UNKNOWN_DATABASE
int locator_initialize(THREAD_ENTRY *thread_p)
int xcache_initialize(THREAD_ENTRY *thread_p)
const char * boot_db_full_name()
EHID * xehash_create(THREAD_ENTRY *thread_p, EHID *ehid, DB_TYPE key_type, int exp_num_entries, OID *class_oid, int attr_id, bool is_tmp)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
enum boot_server_status BOOT_SERVER_STATUS
char * xdisk_get_fullname(THREAD_ENTRY *thread_p, VOLID volid, char *vol_fullname)
db_client_type client_type
int jsp_start_server(const char *db_name, const char *path, int port)
char * fileio_get_volume_label(VOLID vol_id, bool is_peek)
const char * get_program_name() const
#define ER_BO_TRYING_TO_REMOVE_PERMANENT_VOLUME
#define BOOT_NORMAL_CLIENT_TYPE(client_type)
const char * fileio_get_base_file_name(const char *full_name_p)
void er_final(ER_FINAL_CODE do_global_final)
char checksum[TZ_CHECKSUM_SIZE+1]
#define ER_LOG_USER_FILE_UNORDERED_ENTRIES
const VOLID LOG_DBFIRST_VOLID
static int boot_find_rest_permanent_volumes(THREAD_ENTRY *thread_p, bool newvolpath, bool use_volinfo, VOLID volid, int(*fun)(THREAD_ENTRY *thread_p, VOLID xvolid, const char *vlabel, void *args), void *args)
static char boot_Lob_path[PATH_MAX+LOB_PATH_PREFIX_MAX]
char * disk_get_link(THREAD_ENTRY *thread_p, INT16 volid, INT16 *next_volid, char *next_volext_fullname)
void log_final(THREAD_ENTRY *thread_p)
int xboot_compact_db(THREAD_ENTRY *thread_p, OID *class_oids, int n_classes, int space_to_process, int instance_lock_timeout, int class_lock_timeout, bool delete_old_repr, OID *last_processed_class_oid, OID *last_processed_oid, int *total_objects, int *failed_objects, int *modified_objects, int *big_objects, int *initial_last_repr_id)
int prm_get_integer_value(PARAM_ID prm_id)
DISK_ISVALID heap_check_all_heaps(THREAD_ENTRY *thread_p)
static int boot_make_session_server_key(void)
int xcallback_console_print(THREAD_ENTRY *thread_p, char *print_str)
void fileio_make_volume_temp_name(char *vol_tmp_full_name_p, const char *tmp_path_p, const char *tmp_name_p, VOLID vol_id)
#define LOG_ISTRAN_ACTIVE(tdes)
void fileio_close(int vol_fd)
static jmp_buf boot_Init_server_jmpbuf
int xboot_register_client(THREAD_ENTRY *thread_p, BOOT_CLIENT_CREDENTIAL *client_credential, int client_lock_wait, TRAN_ISOLATION client_isolation, TRAN_STATE *tran_state, BOOT_SERVER_CREDENTIAL *server_credential)
#define ER_BO_MISSING_OR_INVALID_CATALOG
int css_init_conn_list(void)
int logpb_recreate_volume_info(THREAD_ENTRY *thread_p)
#define SINGLE_ROW_UPDATE
int logtb_initialize_global_unique_stats_table(THREAD_ENTRY *thread_p)
void boot_server_all_finalize(THREAD_ENTRY *thread_p, ER_FINAL_CODE is_er_final, BOOT_SERVER_SHUTDOWN_MODE shutdown_common_modules)
HFID * disk_get_boot_hfid(THREAD_ENTRY *thread_p, INT16 volid, HFID *hfid)
int sysprm_load_and_init(const char *db_name, const char *conf_file, const int load_flags)
static int boot_xremove_temp_volume(THREAD_ENTRY *thread_p, VOLID volid, const char *vlabel)
int heap_update_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
int catcls_get_server_compat_info(THREAD_ENTRY *thread_p, INTL_CODESET *charset_id_p, char *lang_buf, const int lang_buf_size, char *timezone_checksum)
void session_states_init(THREAD_ENTRY *thread_p)
void xcache_finalize(THREAD_ENTRY *thread_p)
void tde_make_keys_file_fullname(char *keys_vol_fullname, const char *db_full_name, bool ignore_parm)
#define DB_MAX_IDENTIFIER_LENGTH
void heap_create_update_context(HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *oid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p, UPDATE_INPLACE_STYLE in_place)
static char boot_Db_full_name[PATH_MAX]
int heap_manager_initialize(void)
void heap_create_insert_context(HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p)
int xboot_backup(THREAD_ENTRY *thread_p, const char *backup_path, FILEIO_BACKUP_LEVEL backup_level, bool delete_unneeded_logarchives, const char *backup_verbose_file, int num_threads, FILEIO_ZIP_METHOD zip_method, FILEIO_ZIP_LEVEL zip_level, int skip_activelog, int sleep_msecs, bool separate_keys)
int disk_manager_init(THREAD_ENTRY *thread_p, bool load_from_disk)
bool is_restore_from_backup
#define TRAN_LOCK_INFINITE_WAIT
void lock_unlock_object(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, bool force)
void log_restart_emergency(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
char keys_file_path[PATH_MAX]
int qmgr_initialize(THREAD_ENTRY *thread_p)
int initialize_thread_entries(bool with_lock_free)
int disk_set_boot_hfid(THREAD_ENTRY *thread_p, INT16 volid, const HFID *hfid)
void logtb_finalize_global_unique_stats_table(THREAD_ENTRY *thread_p)
#define ER_PRM_CONFLICT_EXISTS_ON_MULTIPLE_SECTIONS
int tde_get_keyinfo(THREAD_ENTRY *thread_p, TDE_KEYINFO *keyinfo)
int boot_dbparm_save_volume(THREAD_ENTRY *thread_p, DB_VOLTYPE voltype, VOLID volid)
int cub_dirname_r(const char *path, char *pathbuf, size_t buflen)
int xheap_create(THREAD_ENTRY *thread_p, HFID *hfid, const OID *class_oid, bool reuse_oid)
void partition_cache_finalize(THREAD_ENTRY *thread_p)
void fileio_dismount(THREAD_ENTRY *thread_p, int vol_fd)
#define DB_MAX_PATH_LENGTH
int perfmon_initialize(int num_trans)
int heap_insert_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, PGBUF_WATCHER *home_hint_p)
const char * rel_name(void)
int fileio_synchronize_all(THREAD_ENTRY *thread_p, bool is_include)
void vacuum_stop_workers(THREAD_ENTRY *thread_p)
void locator_initialize_areas(void)
void fileio_dismount_all(THREAD_ENTRY *thread_p)
int log_create(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname, DKNPAGES npages)
void locator_finalize(THREAD_ENTRY *thread_p)
void event_log_final(void)
#define strncpy_bufsize(buf, str)
const char * er_msg(void)
void disk_manager_final(void)
int logpb_backup(THREAD_ENTRY *thread_p, int num_perm_vols, const char *allbackup_path, FILEIO_BACKUP_LEVEL backup_level, bool delete_unneeded_logarchives, const char *backup_verbose_file_path, int num_threads, FILEIO_ZIP_METHOD zip_method, FILEIO_ZIP_LEVEL zip_level, int skip_activelog, int sleep_msecs, bool separate_keys)
int xboot_compact_start(THREAD_ENTRY *thread_p)
void log_stop_ha_delay_registration()
DKNPAGES xdisk_get_total_numpages(THREAD_ENTRY *thread_p, VOLID volid)
static char boot_Server_session_key[SERVER_SESSION_KEY_SIZE]
int util_compare_filepath(const char *file1, const char *file2)
int logtb_reflect_global_unique_stats_to_btree(THREAD_ENTRY *thread_p)
bool logpb_exist_log(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
int logtb_assign_tran_index(THREAD_ENTRY *thread_p, TRANID trid, TRAN_STATE state, const BOOT_CLIENT_CREDENTIAL *client_credential, TRAN_STATE *current_state, int wait_msecs, TRAN_ISOLATION isolation)
int catcls_find_and_set_cached_class_oid(THREAD_ENTRY *thread_p)
int xvacuum(THREAD_ENTRY *thread_p)
bool cfg_delete_db(DB_INFO **dir_info_p, const char *name)
int es_init(const char *uri)
void catalog_finalize(void)
int logpb_restore(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname, bo_restart_arg *r_args)
static void boot_remove_useless_path_separator(const char *path, char *new_path)
static int failed_objects
void perfmon_finalize(void)
#define db_private_free(thrd, ptr)
HA_SERVER_STATE ha_server_state
int tde_find_first_mk(int vdes, int *mk_index, unsigned char *master_key, time_t *created_time)
int tde_change_mk(THREAD_ENTRY *thread_p, const int mk_index, const unsigned char *master_key, const time_t created_time)
void COMPOSE_FULL_NAME(char *buf, size_t buf_size, const char *path, const char *name)
int cfg_read_directory_ex(int vdes, DB_INFO **info_p, bool write_flag)
static int boot_find_rest_volumes(THREAD_ENTRY *thread_p, BO_RESTART_ARG *r_args, VOLID volid, int(*fun)(THREAD_ENTRY *thread_p, VOLID xvolid, const char *vlabel, void *args), void *args)
static int boot_remove_temp_volume(THREAD_ENTRY *thread_p, VOLID volid, const char *vlabel)
#define ER_BO_UNKNOWN_VOLUME
#define MSGCAT_SET_GENERAL
#define ER_BO_MAXNUM_VOLS_HAS_BEEN_EXCEEDED
#define LOG_SET_CURRENT_TRAN_INDEX(thrd, index)
int pgbuf_flush_all(THREAD_ENTRY *thread_p, VOLID volid)
static bool skip_to_check_ct_classes_for_rebuild
void er_set_with_oserror(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define IO_DEFAULT_PAGE_SIZE
DB_INFO * cfg_add_db(DB_INFO **dir, const char *name, const char *path, const char *logpath, const char *lobpath, const char *host)
#define MSGCAT_CATALOG_CUBRID
int tde_load_mk(int vdes, const TDE_KEYINFO *keyinfo, unsigned char *master_key)
const char * lang_charset_cubrid_name(const INTL_CODESET codeset)
const char * css_ha_mode_string(HA_MODE mode)
void serial_finalize_cache_pool(void)
int xboot_check_db_consistency(THREAD_ENTRY *thread_p, int check_flag, OID *oids, int num_oids, BTID *index_btid)
#define ER_BO_UNABLE_TO_FIND_HOSTNAME
SCAN_CODE heap_first(THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
static int boot_parse_add_volume_extensions(THREAD_ENTRY *thread_p, const char *filename_addmore_vols)
void boot_server_status(BOOT_SERVER_STATUS status)
const char * envvar_get(const char *name)
static void error(const char *msg)
#define ER_BO_SERVER_STATUS
int lang_set_charset_lang(const char *lang_charset)
#define ER_BO_UNABLE_TO_RESTART_SERVER
DISK_ISVALID locator_check_class_names(THREAD_ENTRY *thread_p)
void logtb_free_tran_index(THREAD_ENTRY *thread_p, int tran_index)
bool log_check_system_op_is_started(THREAD_ENTRY *thread_p)
#define ER_BO_DIRECTORY_DOESNOT_EXIST
void log_set_db_restore_time(THREAD_ENTRY *thread_p, INT64 db_restore_time)
#define LOG_FIND_THREAD_TRAN_INDEX(thrd)
#define HFID_IS_NULL(hfid)
size_t strlcpy(char *dst, const char *src, size_t siz)
int vacuum_initialize(THREAD_ENTRY *thread_p, int vacuum_log_block_npages, VFID *vacuum_data_vfid, VFID *dropped_files_vfid, bool is_restore)
const VOLID LOG_DBTDE_KEYS_VOLID
void spage_boot(THREAD_ENTRY *thread_p)
static char * boot_volume_info_log_path(char *log_path)
int vacuum_boot(THREAD_ENTRY *thread_p)
bool boot_set_skip_check_ct_classes(bool val)
bool tde_validate_keys_file(int vdes)
int cfg_read_directory(DB_INFO **info_p, bool write_flag)
int tde_cipher_initialize(THREAD_ENTRY *thread_p, const HFID *keyinfo_hfid, const char *mk_path_given)
int fileio_synchronize(THREAD_ENTRY *thread_p, int vol_fd, const char *vlabel, FILEIO_SYNC_OPTION sync_dwb)
enum boot_server_shutdown_mode BOOT_SERVER_SHUTDOWN_MODE
int xboot_soft_rename(THREAD_ENTRY *thread_p, const char *old_db_name, const char *new_db_name, const char *new_db_path, const char *new_log_path, const char *new_db_server_host, const char *new_volext_path, const char *fileof_vols_and_renamepaths, bool new_db_overwrite, bool extern_rename, bool force_delete)
CTID * catalog_create(THREAD_ENTRY *thread_p, CTID *catalog_id_p)
void disk_unlock_extend(void)
int logpb_check_exist_any_volumes(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname, char *first_vol, bool *is_exist)
#define BOOT_FORMAT_MAX_LENGTH
void fpcache_finalize(THREAD_ENTRY *thread_p)
int serial_initialize_cache_pool(THREAD_ENTRY *thread_p)
const char * get_db_user() const
int disk_get_boot_db_charset(THREAD_ENTRY *thread_p, INT16 volid, INTL_CODESET *db_charset)
#define free_and_init(ptr)
int heap_scancache_quick_start_with_class_hfid(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid)
int fpcache_initialize(THREAD_ENTRY *thread_p)
char * prm_get_string_value(PARAM_ID prm_id)
bool xboot_shutdown_server(REFPTR(THREAD_ENTRY, thread_p), ER_FINAL_CODE is_er_final)
DISK_ISVALID heap_check_heap_file(THREAD_ENTRY *thread_p, HFID *hfid)
int tde_copy_keys_file(THREAD_ENTRY *thread_p, const char *dest_fullname, const char *src_fullname, bool keep_dest_mount, bool keep_src_mount)
void fileio_make_volume_ext_given_name(char *vol_ext_full_name_p, const char *ext_path_p, const char *ext_name_p)
enum intl_codeset INTL_CODESET
int qfile_initialize_list_cache(THREAD_ENTRY *thread_p)
bool prm_get_bool_value(PARAM_ID prm_id)
int logpb_copy_database(THREAD_ENTRY *thread_p, VOLID num_perm_vols, const char *to_db_fullname, const char *to_logpath, const char *to_prefix_logname, const char *toext_path, const char *fileof_vols_and_copypaths)
int intl_mbs_casecmp(const char *mbs1, const char *mbs2)
int css_check_ha_server_state_for_client(THREAD_ENTRY *thread_p, int whence)
HA_SERVER_STATE css_ha_server_state(void)
int boot_compact_start(THREAD_ENTRY *thread_p)
int boot_get_new_volume_name_and_id(THREAD_ENTRY *thread_p, DB_VOLTYPE voltype, const char *given_path, const char *given_name, char *fullname_newvol_out, VOLID *volid_newvol_out)
int log_recreate(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname, DKNPAGES log_npages, FILE *out_fp)
static int boot_remove_all_temp_volumes(THREAD_ENTRY *thread_p, REMOVE_TEMP_VOL_ACTION delete_action)
int catcls_get_db_collation(THREAD_ENTRY *thread_p, LANG_COLL_COMPAT **db_collations, int *coll_cnt)
void heap_flush(THREAD_ENTRY *thread_p, const OID *oid)
static int boot_remove_all_volumes(THREAD_ENTRY *thread_p, const char *db_fullname, const char *log_path, const char *log_prefix, bool dirty_rem, bool force_delete)
void vacuum_sa_reflect_last_blockid(THREAD_ENTRY *thread_p)
char * msgcat_message(int cat_id, int set_id, int msg_id)
const char * prm_get_name(PARAM_ID prm_id)
int heap_assign_address(THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, int expected_length)
int xboot_find_number_temp_volumes(THREAD_ENTRY *thread_p)
void log_abort_all_active_transaction(THREAD_ENTRY *thread_p)
#define SERVER_SESSION_KEY_SIZE
char * strdup(const char *str)
int xboot_delete(const char *db_name, bool force_delete, BOOT_SERVER_SHUTDOWN_MODE shutdown_common_modules)
void event_log_init(const char *db_name)
void initialize(entry *&my_entry)
DISK_ISVALID btree_repair_prev_link(THREAD_ENTRY *thread_p, OID *oid, BTID *index_btid, bool repair)
static bool boot_Init_server_is_canceled
#define BTID_IS_NULL(btid)
DISK_ISVALID disk_check(THREAD_ENTRY *thread_p, bool repair)
int dwb_destroy(THREAD_ENTRY *thread_p)
const char * xboot_get_server_session_key(void)
#define ER_TDE_INVALID_KEYS_FILE
static OID boot_Header_oid
enum ha_server_state HA_SERVER_STATE
#define VPID_GET_FROM_OID(vpid_ptr, oid_ptr)
int vacuum_create_file_for_vacuum_data(THREAD_ENTRY *thread_p, VFID *vacuum_data_vfid)
int file_tracker_create(THREAD_ENTRY *thread_p, VFID *vfid_tracker_out)
#define ER_BO_CANNOT_ACCESS_MESSAGE_CATALOG
void cfg_write_directory_ex(int vdes, const DB_INFO *databases)
void disk_lock_extend(void)
int logpb_delete(THREAD_ENTRY *thread_p, VOLID num_perm_vols, const char *db_fullname, const char *logpath, const char *prefix_logname, bool force_delete)
int xboot_initialize_server(const BOOT_CLIENT_CREDENTIAL *client_credential, BOOT_DB_PATH_INFO *db_path_info, bool db_overwrite, const char *file_addmore_vols, volatile DKNPAGES db_npages, PGLENGTH db_desired_pagesize, volatile DKNPAGES log_npages, PGLENGTH db_desired_log_page_size, OID *rootclass_oid, HFID *rootclass_hfid, int client_lock_wait, TRAN_ISOLATION client_isolation)
int lang_check_coll_compat(const LANG_COLL_COMPAT *coll_array, const int coll_cnt, const char *client_text, const char *server_text)
LOG_PAGEID logpb_checkpoint(THREAD_ENTRY *thread_p)
void prm_set_bool_value(PARAM_ID prm_id, bool value)
#define ER_TDE_CIPHER_LOAD_FAIL
#define ER_BO_DATABASE_EXISTS
#define LANG_MAX_LANGNAME
int qfile_finalize_list_cache(THREAD_ENTRY *thread_p)
#define CUB_MAXHOSTNAMELEN
int heap_get_class_info(THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid_out, FILE_TYPE *ftype_out, char **classname_out)
static BOOT_DB_PARM * boot_Db_parm
#define strncpy_size(buf, str, size)
#define LOB_PATH_DEFAULT_PREFIX
DISK_ISVALID btree_check_all(THREAD_ENTRY *thread_p)
DISK_ISVALID locator_check_all_entries_of_all_btrees(THREAD_ENTRY *thread_p, bool repair)
VOLID boot_find_next_permanent_volid(THREAD_ENTRY *thread_p)
void log_set_ha_promotion_time(THREAD_ENTRY *thread_p, INT64 ha_promotion_time)
const char * lang_get_Lang_name(void)
int fileio_open(const char *vol_label_p, int flags, int mode)
int xboot_copy(REFPTR(THREAD_ENTRY, thread_p), const char *from_dbname, const char *new_db_name, const char *new_db_path, const char *new_log_path, const char *new_lob_path, const char *new_db_server_host, const char *new_volext_path, const char *fileof_vols_and_copypaths, bool new_db_overwrite)
void cfg_free_directory(DB_INFO *databases)
void qmgr_finalize(THREAD_ENTRY *thread_p)
#define HFID_COPY(hfid_ptr1, hfid_ptr2)
void fileio_make_volume_info_name(char *vol_info_name_p, const char *db_full_name_p)
#define ER_TDE_RESTORE_CHANGE_MASTER_KEY
int boot_compact_db(THREAD_ENTRY *thread_p, OID *class_oids, int n_classes, int space_to_process, int instance_lock_timeout, int class_lock_timeout, bool delete_old_repr, OID *last_processed_class_oid, OID *last_processed_oid, int *total_objects, int *failed_objects, int *modified_objects, int *big_objects, int *initial_last_repr_id)
#define TDE_MASTER_KEY_LENGTH
int css_notify_ha_log_applier_state(THREAD_ENTRY *thread_p, HA_LOG_APPLIER_STATE state)
SIGNAL_HANDLER_FUNCTION os_set_signal_handler(const int sig_no, SIGNAL_HANDLER_FUNCTION sig_handler)
#define GETHOSTNAME(p, l)
#define VFID_SET_NULL(vfid_ptr)
ES_TYPE es_get_type(const char *uri)
int partition_cache_init(THREAD_ENTRY *thread_p)
int db_set_page_size(PGLENGTH io_page_size, PGLENGTH log_page_size)
int intl_identifier_upper(const char *src, char *dst)
DISK_ISVALID catalog_check_consistency(THREAD_ENTRY *thread_p)
enum er_final_code ER_FINAL_CODE
#define ER_ES_NO_LOB_PATH
DISK_ISVALID file_tracker_check(THREAD_ENTRY *thread_p)
const char * get_db_name() const
static int boot_create_all_volumes(THREAD_ENTRY *thread_p, const BOOT_CLIENT_CREDENTIAL *client_credential, const char *db_comments, DKNPAGES db_npages, const char *file_addmore_vols, const char *log_path, const char *log_prefix, DKNPAGES log_npages, int client_lock_wait, TRAN_ISOLATION client_isolation)
DB_INFO * cfg_find_db_list(DB_INFO *db_info_list_p, const char *name)
int fileio_get_volume_descriptor(VOLID vol_id)
#define ER_BO_CANNOT_FINE_VOLINFO
int logpb_rename_all_volumes_files(THREAD_ENTRY *thread_p, VOLID num_perm_vols, const char *to_db_fullname, const char *to_logpath, const char *to_prefix_logname, const char *toext_path, const char *fileof_vols_and_renamepaths, bool extern_rename, bool force_delete)
void cfg_write_directory(const DB_INFO *databases)
SCAN_CODE heap_get_class_record(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes_p, HEAP_SCANCACHE *scan_cache, int ispeeking)
static void boot_remove_unknown_temp_volumes(THREAD_ENTRY *thread_p)