Merge lp:~vkolesnikov/pbxt/pbxt-07-diskfull into lp:pbxt/1.0.07-rc

Proposed by Vladimir Kolesnikov
Status: Merged
Merge reported by: Paul McCullagh
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-07-diskfull
Merge into: lp:pbxt/1.0.07-rc
Diff against target: None lines
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-07-diskfull
Reviewer Review Type Date Requested Status
PBXT Core Pending
Review via email: mp+8554@code.launchpad.net
To post a comment you must log in.
548. By Vladimir Kolesnikov

added more code comments, small cleanups

549. By Vladimir Kolesnikov

small cleanups

550. By Vladimir Kolesnikov

added a condition to exception throwing code in pbxt_init

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2009-07-07 14:27:29 +0000
+++ ChangeLog 2009-07-10 14:01:07 +0000
@@ -1,6 +1,16 @@
1PBXT Release Notes1PBXT Release Notes
2==================2==================
33
4------- 1.0.07p RC - 2009-07-10
5
6RN258: updated xt_p_join implementation for Windows to check if a thread has already exited or has not yet started
7
8RN257: Removed false assertion that could fail during restore if a transaction log page was zero-filled
9
10RN256: Update datalog eof pointer only if write opearions were sucessful
11
12RN255: Added re-allocation of of filemap if allocating the of the new map failed. This often happens if there's not enough space on disk.
13
4------- 1.0.07o RC - 2009-07-0714------- 1.0.07o RC - 2009-07-07
515
6RN254: When a table with a corrupted index is detected, PBXT creates a file called 'repair-pending' in the pbxt directory, with the name of the table in it. Each table in the file is listed on a line by itself (the last line has no trailing \n). When the table is repaired (using the REPAIR TABLE command), this entry is removed from the file.16RN254: When a table with a corrupted index is detected, PBXT creates a file called 'repair-pending' in the pbxt directory, with the name of the table in it. Each table in the file is listed on a line by itself (the last line has no trailing \n). When the table is repaired (using the REPAIR TABLE command), this entry is removed from the file.
717
=== modified file 'src/datalog_xt.cc'
--- src/datalog_xt.cc 2008-12-11 09:55:44 +0000
+++ src/datalog_xt.cc 2009-07-10 14:01:07 +0000
@@ -208,7 +208,8 @@
208 }208 }
209 break;209 break;
210 default:210 default:
211 ASSERT_NS(FALSE);211 /* assume 0 - eof */
212 //ASSERT_NS(FALSE);
212 goto return_empty;213 goto return_empty;
213 }214 }
214215
@@ -1110,7 +1111,6 @@
11101111
1111 *log_id = dlb_data_log->dlf_log_id;1112 *log_id = dlb_data_log->dlf_log_id;
1112 *out_offset = dlb_data_log->dlf_log_eof;1113 *out_offset = dlb_data_log->dlf_log_eof;
1113 dlb_data_log->dlf_log_eof += req_size;
1114 return OK;1114 return OK;
1115}1115}
11161116
@@ -1158,6 +1158,8 @@
11581158
1159 if (!xt_pwrite_file(dlb_data_log->dlf_log_file, log_offset, size, data, &thread->st_statistics.st_data, thread))1159 if (!xt_pwrite_file(dlb_data_log->dlf_log_file, log_offset, size, data, &thread->st_statistics.st_data, thread))
1160 return FAILED;1160 return FAILED;
1161
1162 dlb_data_log->dlf_log_eof += size;
1161#ifdef DEBUG1163#ifdef DEBUG
1162 if (log_offset + size > dlb_max_write_offset)1164 if (log_offset + size > dlb_max_write_offset)
1163 dlb_max_write_offset = log_offset + size;1165 dlb_max_write_offset = log_offset + size;
@@ -1179,10 +1181,12 @@
1179 if (dlb_buffer_size >= dlb_buffer_len + size) {1181 if (dlb_buffer_size >= dlb_buffer_len + size) {
1180 memcpy(dlb_log_buffer + dlb_buffer_len, data, size);1182 memcpy(dlb_log_buffer + dlb_buffer_len, data, size);
1181 dlb_buffer_len += size;1183 dlb_buffer_len += size;
1184 dlb_data_log->dlf_log_eof += size;
1182 return OK;1185 return OK;
1183 }1186 }
1184 }1187 }
1185 dlb_flush_log(FALSE, thread);1188 if (dlb_flush_log(FALSE, thread) != OK)
1189 return FAILED;
1186 }1190 }
1187 1191
1188 ASSERT_NS(dlb_buffer_len == 0);1192 ASSERT_NS(dlb_buffer_len == 0);
@@ -1191,6 +1195,7 @@
1191 dlb_buffer_offset = log_offset;1195 dlb_buffer_offset = log_offset;
1192 dlb_buffer_len = size;1196 dlb_buffer_len = size;
1193 memcpy(dlb_log_buffer, data, size);1197 memcpy(dlb_log_buffer, data, size);
1198 dlb_data_log->dlf_log_eof += size;
1194 return OK;1199 return OK;
1195 }1200 }
11961201
@@ -1202,6 +1207,7 @@
1202 dlb_max_write_offset = log_offset + size;1207 dlb_max_write_offset = log_offset + size;
1203#endif1208#endif
1204 dlb_flush_required = TRUE;1209 dlb_flush_required = TRUE;
1210 dlb_data_log->dlf_log_eof += size;
1205 return OK;1211 return OK;
1206}1212}
12071213
12081214
=== modified file 'src/datalog_xt.h'
--- src/datalog_xt.h 2008-12-05 13:50:58 +0000
+++ src/datalog_xt.h 2009-07-10 14:01:07 +0000
@@ -93,6 +93,7 @@
93 u_int dlf_open_count; /* Number of open log files. */93 u_int dlf_open_count; /* Number of open log files. */
94 XTOpenLogFilePtr dlf_free_list; /* The open file free list. */94 XTOpenLogFilePtr dlf_free_list; /* The open file free list. */
95 off_t dlf_log_eof;95 off_t dlf_log_eof;
96 //off_t dlf_last_inc; /* The size of the last added record */
96 off_t dlf_start_offset; /* Start offset for garbage collection. */97 off_t dlf_start_offset; /* Start offset for garbage collection. */
97 off_t dlf_garbage_count; /* The amount of garbage in the log file. */98 off_t dlf_garbage_count; /* The amount of garbage in the log file. */
98 XTOpenFilePtr dlf_log_file; /* The open file handle (if the log is in exclusive use!!). */99 XTOpenFilePtr dlf_log_file; /* The open file handle (if the log is in exclusive use!!). */
99100
=== modified file 'src/filesys_xt.cc'
--- src/filesys_xt.cc 2009-07-07 14:27:29 +0000
+++ src/filesys_xt.cc 2009-07-10 14:01:07 +0000
@@ -1356,14 +1356,23 @@
1356 }1356 }
1357 mm->mm_start = NULL;1357 mm->mm_start = NULL;
1358#ifdef XT_WIN1358#ifdef XT_WIN
1359 if (!CloseHandle(mm->mm_mapdes))1359 /* It is possible that a previous remap attempt has failed: the map was closed
1360 * but the new map was not allocated (e.g. because of insufficient disk space).
1361 * In this case mm->mm_mapdes will be NULL.
1362 */
1363 if (mm->mm_mapdes && !CloseHandle(mm->mm_mapdes))
1360 return xt_register_ferrno(XT_REG_CONTEXT, fs_get_win_error(), xt_file_path(map));1364 return xt_register_ferrno(XT_REG_CONTEXT, fs_get_win_error(), xt_file_path(map));
1361 mm->mm_mapdes = NULL;1365 mm->mm_mapdes = NULL;
1362#endif1366#endif
1367 off_t old_size = mm->mm_length;
1363 mm->mm_length = new_size;1368 mm->mm_length = new_size;
13641369
1365 if (!fs_map_file(mm, map->fr_file, TRUE))1370 if (!fs_map_file(mm, map->fr_file, TRUE)) {
1371 /* Try to restore old mapping */
1372 mm->mm_length = old_size;
1373 fs_map_file(mm, map->fr_file, FALSE);
1366 return FAILED;1374 return FAILED;
1375 }
1367 }1376 }
1368 return OK;1377 return OK;
1369 1378
13701379
=== modified file 'src/ha_pbxt.cc'
--- src/ha_pbxt.cc 2009-02-23 22:43:55 +0000
+++ src/ha_pbxt.cc 2009-07-10 14:01:07 +0000
@@ -1144,7 +1144,7 @@
1144#ifndef DRIZZLED1144#ifndef DRIZZLED
1145 myxt_mutex_lock(&LOCK_plugin);1145 myxt_mutex_lock(&LOCK_plugin);
1146#endif1146#endif
1147 xt_throw(self);1147 xt_throw_error(self, XT_REG_CONTEXT, XT_SYSTEM_ERROR, 0, "Initialization failed");
1148 }1148 }
1149 cont_(b);1149 cont_(b);
11501150
11511151
=== modified file 'src/pthread_xt.cc'
--- src/pthread_xt.cc 2008-12-18 10:25:11 +0000
+++ src/pthread_xt.cc 2009-07-10 14:01:07 +0000
@@ -348,19 +348,26 @@
348348
349int xt_p_join(pthread_t thread, void **value)349int xt_p_join(pthread_t thread, void **value)
350{350{
351 switch (WaitForSingleObject(thread, INFINITE)) {351 DWORD exitcode;
352 case WAIT_OBJECT_0: 352
353 case WAIT_TIMEOUT:353 while(1) {
354 /* Don't do this! According to the Win docs:354 switch (WaitForSingleObject(thread, 10000)) {
355 * _endthread automatically closes the thread handle 355 case WAIT_OBJECT_0:
356 * (whereas _endthreadex does not). Therefore, when using 356 return 0;
357 * _beginthread and _endthread, do not explicitly close the 357 case WAIT_TIMEOUT:
358 * thread handle by calling the Win32 CloseHandle API.358 /* Don't do this! According to the Win docs:
359 CloseHandle(thread);359 * _endthread automatically closes the thread handle
360 */360 * (whereas _endthreadex does not). Therefore, when using
361 break;361 * _beginthread and _endthread, do not explicitly close the
362 case WAIT_FAILED:362 * thread handle by calling the Win32 CloseHandle API.
363 return GetLastError();363 CloseHandle(thread);
364 */
365 if (GetExitCodeThread(thread, &exitcode) && (exitcode == STILL_ACTIVE))
366 break;
367 return 0;
368 case WAIT_FAILED:
369 return GetLastError();
370 }
364 }371 }
365 return 0;372 return 0;
366}373}
367374
=== modified file 'src/restart_xt.cc'
--- src/restart_xt.cc 2009-07-07 14:21:07 +0000
+++ src/restart_xt.cc 2009-07-10 14:01:07 +0000
@@ -1498,7 +1498,9 @@
1498 /* I could use tab_ind_rec_log_id, but this may be a problem, if1498 /* I could use tab_ind_rec_log_id, but this may be a problem, if
1499 * recovery does not recover up to the last committed transaction.1499 * recovery does not recover up to the last committed transaction.
1500 */ 1500 */
1501 check_index = ws->ws_in_recover && xt_comp_log_pos(log_id, log_offset, ws->ws_ind_rec_log_id, ws->ws_ind_rec_log_offset) >= 0;1501 check_index = ws->ws_in_recover
1502 && xt_comp_log_pos(log_id, log_offset, ws->ws_ind_rec_log_id, ws->ws_ind_rec_log_offset) >= 0
1503 && tab->tab_dic.dic_key_count;
1502 xres_apply_change(self, ws->ws_ot, record, TRUE, check_index, &ws->ws_rec_buf);1504 xres_apply_change(self, ws->ws_ot, record, TRUE, check_index, &ws->ws_rec_buf);
1503 tab->tab_head_op_seq = op_seq;1505 tab->tab_head_op_seq = op_seq;
1504 if (tab->tab_wr_wake_freeer) {1506 if (tab->tab_wr_wake_freeer) {
15051507
=== modified file 'src/strutil_xt.cc'
--- src/strutil_xt.cc 2009-07-07 14:29:30 +0000
+++ src/strutil_xt.cc 2009-07-10 14:01:07 +0000
@@ -367,7 +367,7 @@
367367
368xtPublic c_char *xt_get_version(void)368xtPublic c_char *xt_get_version(void)
369{369{
370 return "1.0.07o RC";370 return "1.0.07p RC";
371}371}
372372
373/* Copy and URL decode! */373/* Copy and URL decode! */
374374
=== modified file 'src/xactlog_xt.cc'
--- src/xactlog_xt.cc 2009-06-30 11:36:08 +0000
+++ src/xactlog_xt.cc 2009-07-10 14:01:07 +0000
@@ -1046,6 +1046,7 @@
1046 /* [(8)] Flush the compactor log. */1046 /* [(8)] Flush the compactor log. */
1047 xt_lock_mutex_ns(&xl_db->db_co_dlog_lock);1047 xt_lock_mutex_ns(&xl_db->db_co_dlog_lock);
1048 if (!xl_db->db_co_thread->st_dlog_buf.dlb_flush_log(TRUE, thread)) {1048 if (!xl_db->db_co_thread->st_dlog_buf.dlb_flush_log(TRUE, thread)) {
1049 xl_log_bytes_written -= part_size;
1049 xt_unlock_mutex_ns(&xl_db->db_co_dlog_lock);1050 xt_unlock_mutex_ns(&xl_db->db_co_dlog_lock);
1050 goto write_failed;1051 goto write_failed;
1051 }1052 }
@@ -1053,8 +1054,10 @@
1053 }1054 }
10541055
1055 /* And flush if required: */1056 /* And flush if required: */
1056 if (!xt_flush_file(xl_log_file, &thread->st_statistics.st_xlog, thread))1057 if (!xt_flush_file(xl_log_file, &thread->st_statistics.st_xlog, thread)) {
1058 xl_log_bytes_written -= part_size;
1057 goto write_failed;1059 goto write_failed;
1060 }
10581061
1059 xl_log_bytes_flushed = xl_log_bytes_written;1062 xl_log_bytes_flushed = xl_log_bytes_written;
10601063
@@ -2398,9 +2401,6 @@
2398 if (!record) {2401 if (!record) {
2399 break;2402 break;
2400 }2403 }
2401 /* Count the number of bytes read from the log: */
2402 db->db_xlog.xl_log_bytes_read += ws->ws_seqread.xseq_record_len;
2403
2404 switch (record->xl.xl_status_1) {2404 switch (record->xl.xl_status_1) {
2405 case XT_LOG_ENT_HEADER:2405 case XT_LOG_ENT_HEADER:
2406 break;2406 break;
@@ -2424,6 +2424,8 @@
2424 xt_xres_apply_in_order(self, ws, ws->ws_seqread.xseq_rec_log_id, ws->ws_seqread.xseq_rec_log_offset, record);2424 xt_xres_apply_in_order(self, ws, ws->ws_seqread.xseq_rec_log_id, ws->ws_seqread.xseq_rec_log_offset, record);
2425 break;2425 break;
2426 }2426 }
2427 /* Count the number of bytes read from the log: */
2428 db->db_xlog.xl_log_bytes_read += ws->ws_seqread.xseq_record_len;
2427 }2429 }
2428 }2430 }
24292431

Subscribers

People subscribed via source and target branches

to all changes: