Merge lp:~vkolesnikov/pbxt/pbxt-diskfull into lp:pbxt

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2009-07-07 10:54:25 +0000
+++ ChangeLog 2009-07-13 10:48:25 +0000
@@ -1,6 +1,14 @@
1PBXT Release Notes1PBXT Release Notes
2==================2==================
33
4RN258: updated xt_p_join implementation for Windows to check if a thread has already exited or has not yet started
5
6RN257: Removed false assertion that could fail during restore if a transaction log page was zero-filled
7
8RN256: Update datalog eof pointer only if write opearions were sucessful
9
10RN255: 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.
11
4------- 1.0.08 RC2 - 2009-06-3012------- 1.0.08 RC2 - 2009-06-30
513
6RN253: Use fcntl(F_FULLFSYNC) instead of fsync on platforms that support it. Improper fsync operation was presumably the reason of index corruption on Mac OS X14RN253: Use fcntl(F_FULLFSYNC) instead of fsync on platforms that support it. Improper fsync operation was presumably the reason of index corruption on Mac OS X
715
=== modified file 'src/datalog_xt.cc'
--- src/datalog_xt.cc 2009-05-19 14:13:25 +0000
+++ src/datalog_xt.cc 2009-07-13 10:48:25 +0000
@@ -1110,7 +1110,6 @@
11101110
1111 *log_id = dlb_data_log->dlf_log_id;1111 *log_id = dlb_data_log->dlf_log_id;
1112 *out_offset = dlb_data_log->dlf_log_eof;1112 *out_offset = dlb_data_log->dlf_log_eof;
1113 dlb_data_log->dlf_log_eof += req_size;
1114 return OK;1113 return OK;
1115}1114}
11161115
@@ -1158,6 +1157,12 @@
11581157
1159 if (!xt_pwrite_file(dlb_data_log->dlf_log_file, log_offset, size, data, &thread->st_statistics.st_data, thread))1158 if (!xt_pwrite_file(dlb_data_log->dlf_log_file, log_offset, size, data, &thread->st_statistics.st_data, thread))
1160 return FAILED;1159 return FAILED;
1160
1161 /* Increment of dlb_data_log->dlf_log_eof was moved here from dlb_get_log_offset()
1162 * to ensure it is done after a successful update of the log, otherwise otherwise a
1163 * gap occurs in the log which cause eof to be detected in middle of the log
1164 */
1165 dlb_data_log->dlf_log_eof += size;
1161#ifdef DEBUG1166#ifdef DEBUG
1162 if (log_offset + size > dlb_max_write_offset)1167 if (log_offset + size > dlb_max_write_offset)
1163 dlb_max_write_offset = log_offset + size;1168 dlb_max_write_offset = log_offset + size;
@@ -1179,10 +1184,12 @@
1179 if (dlb_buffer_size >= dlb_buffer_len + size) {1184 if (dlb_buffer_size >= dlb_buffer_len + size) {
1180 memcpy(dlb_log_buffer + dlb_buffer_len, data, size);1185 memcpy(dlb_log_buffer + dlb_buffer_len, data, size);
1181 dlb_buffer_len += size;1186 dlb_buffer_len += size;
1187 dlb_data_log->dlf_log_eof += size;
1182 return OK;1188 return OK;
1183 }1189 }
1184 }1190 }
1185 dlb_flush_log(FALSE, thread);1191 if (dlb_flush_log(FALSE, thread) != OK)
1192 return FAILED;
1186 }1193 }
1187 1194
1188 ASSERT_NS(dlb_buffer_len == 0);1195 ASSERT_NS(dlb_buffer_len == 0);
@@ -1191,6 +1198,7 @@
1191 dlb_buffer_offset = log_offset;1198 dlb_buffer_offset = log_offset;
1192 dlb_buffer_len = size;1199 dlb_buffer_len = size;
1193 memcpy(dlb_log_buffer, data, size);1200 memcpy(dlb_log_buffer, data, size);
1201 dlb_data_log->dlf_log_eof += size;
1194 return OK;1202 return OK;
1195 }1203 }
11961204
@@ -1202,6 +1210,7 @@
1202 dlb_max_write_offset = log_offset + size;1210 dlb_max_write_offset = log_offset + size;
1203#endif1211#endif
1204 dlb_flush_required = TRUE;1212 dlb_flush_required = TRUE;
1213 dlb_data_log->dlf_log_eof += size;
1205 return OK;1214 return OK;
1206}1215}
12071216
12081217
=== modified file 'src/filesys_xt.cc'
--- src/filesys_xt.cc 2009-07-07 10:54:25 +0000
+++ src/filesys_xt.cc 2009-07-13 10:48:25 +0000
@@ -1384,14 +1384,23 @@
1384 }1384 }
1385 mm->mm_start = NULL;1385 mm->mm_start = NULL;
1386#ifdef XT_WIN1386#ifdef XT_WIN
1387 if (!CloseHandle(mm->mm_mapdes))1387 /* It is possible that a previous remap attempt has failed: the map was closed
1388 * but the new map was not allocated (e.g. because of insufficient disk space).
1389 * In this case mm->mm_mapdes will be NULL.
1390 */
1391 if (mm->mm_mapdes && !CloseHandle(mm->mm_mapdes))
1388 return xt_register_ferrno(XT_REG_CONTEXT, fs_get_win_error(), xt_file_path(map));1392 return xt_register_ferrno(XT_REG_CONTEXT, fs_get_win_error(), xt_file_path(map));
1389 mm->mm_mapdes = NULL;1393 mm->mm_mapdes = NULL;
1390#endif1394#endif
1395 off_t old_size = mm->mm_length;
1391 mm->mm_length = new_size;1396 mm->mm_length = new_size;
13921397
1393 if (!fs_map_file(mm, map->fr_file, TRUE))1398 if (!fs_map_file(mm, map->fr_file, TRUE)) {
1399 /* Try to restore old mapping */
1400 mm->mm_length = old_size;
1401 fs_map_file(mm, map->fr_file, FALSE);
1394 return FAILED;1402 return FAILED;
1403 }
1395 }1404 }
1396 return OK;1405 return OK;
1397 1406
13981407
=== modified file 'src/ha_pbxt.cc'
--- src/ha_pbxt.cc 2009-07-02 12:13:58 +0000
+++ src/ha_pbxt.cc 2009-07-13 10:48:25 +0000
@@ -1174,7 +1174,11 @@
1174#ifndef DRIZZLED1174#ifndef DRIZZLED
1175 myxt_mutex_lock(&LOCK_plugin);1175 myxt_mutex_lock(&LOCK_plugin);
1176#endif1176#endif
1177 xt_throw(self);1177 /* It is possible that the error was reset by cleanup code.
1178 * Set a generic error code in that case.
1179 */
1180 if (!self->t_exception.e_xt_err)
1181 xt_throw_error(self, XT_REG_CONTEXT, XT_SYSTEM_ERROR, 0, "Initialization failed");
1178 }1182 }
1179 cont_(b);1183 cont_(b);
11801184
11811185
=== modified file 'src/pthread_xt.cc'
--- src/pthread_xt.cc 2009-01-19 19:03:45 +0000
+++ src/pthread_xt.cc 2009-07-13 10:48:25 +0000
@@ -395,20 +395,31 @@
395395
396int xt_p_join(pthread_t thread, void **value)396int xt_p_join(pthread_t thread, void **value)
397{397{
398 switch (WaitForSingleObject(thread, INFINITE)) {398 DWORD exitcode;
399 case WAIT_OBJECT_0: 399
400 case WAIT_TIMEOUT:400 while(1) {
401 /* Don't do this! According to the Win docs:401 switch (WaitForSingleObject(thread, 10000)) {
402 * _endthread automatically closes the thread handle 402 case WAIT_OBJECT_0:
403 * (whereas _endthreadex does not). Therefore, when using 403 return 0;
404 * _beginthread and _endthread, do not explicitly close the 404 case WAIT_TIMEOUT:
405 * thread handle by calling the Win32 CloseHandle API.405 /* Don't do this! According to the Win docs:
406 CloseHandle(thread);406 * _endthread automatically closes the thread handle
407 */407 * (whereas _endthreadex does not). Therefore, when using
408 break;408 * _beginthread and _endthread, do not explicitly close the
409 case WAIT_FAILED:409 * thread handle by calling the Win32 CloseHandle API.
410 return GetLastError();410 CloseHandle(thread);
411 */
412 /* This is done so that if the thread was not [yet] in the running
413 * state when this function was called we won't deadlock here.
414 */
415 if (GetExitCodeThread(thread, &exitcode) && (exitcode == STILL_ACTIVE))
416 break;
417 return 0;
418 case WAIT_FAILED:
419 return GetLastError();
420 }
411 }421 }
422
412 return 0;423 return 0;
413}424}
414425
415426
=== modified file 'src/restart_xt.cc'
--- src/restart_xt.cc 2009-06-11 08:02:28 +0000
+++ src/restart_xt.cc 2009-07-13 10:48:25 +0000
@@ -629,6 +629,9 @@
629 xtWord1 *rec_data = NULL;629 xtWord1 *rec_data = NULL;
630 XTTabRecFreeDPtr free_data;630 XTTabRecFreeDPtr free_data;
631631
632 if (tab->tab_dic.dic_key_count == 0)
633 check_index = FALSE;
634
632 switch (record->xl.xl_status_1) {635 switch (record->xl.xl_status_1) {
633 case XT_LOG_ENT_REC_MODIFIED:636 case XT_LOG_ENT_REC_MODIFIED:
634 case XT_LOG_ENT_UPDATE:637 case XT_LOG_ENT_UPDATE:
@@ -642,7 +645,7 @@
642 /* This should be done before we apply change to table, as otherwise we lose645 /* This should be done before we apply change to table, as otherwise we lose
643 * the key value that we need to remove from index646 * the key value that we need to remove from index
644 */647 */
645 if (check_index && ot->ot_table->tab_dic.dic_key_count && record->xl.xl_status_1 == XT_LOG_ENT_REC_MODIFIED) {648 if (check_index && record->xl.xl_status_1 == XT_LOG_ENT_REC_MODIFIED) {
646 if ((rec_data = xres_load_record(self, ot, rec_id, NULL, 0, rec_buf, tab->tab_dic.dic_ind_cols_req)))649 if ((rec_data = xres_load_record(self, ot, rec_id, NULL, 0, rec_buf, tab->tab_dic.dic_ind_cols_req)))
647 xres_remove_index_entries(ot, rec_id, rec_data); 650 xres_remove_index_entries(ot, rec_id, rec_data);
648 }651 }
@@ -652,7 +655,7 @@
652 xt_throw(self);655 xt_throw(self);
653 tab->tab_bytes_to_flush += len;656 tab->tab_bytes_to_flush += len;
654657
655 if (check_index && ot->ot_table->tab_dic.dic_key_count) {658 if (check_index) {
656 switch (record->xl.xl_status_1) {659 switch (record->xl.xl_status_1) {
657 case XT_LOG_ENT_DELETE:660 case XT_LOG_ENT_DELETE:
658 case XT_LOG_ENT_DELETE_BG:661 case XT_LOG_ENT_DELETE_BG:
659662
=== modified file 'src/xactlog_xt.cc'
--- src/xactlog_xt.cc 2009-06-30 15:58:15 +0000
+++ src/xactlog_xt.cc 2009-07-13 10:48:25 +0000
@@ -1132,6 +1132,7 @@
1132 /* [(8)] Flush the compactor log. */1132 /* [(8)] Flush the compactor log. */
1133 xt_lock_mutex_ns(&xl_db->db_co_dlog_lock);1133 xt_lock_mutex_ns(&xl_db->db_co_dlog_lock);
1134 if (!xl_db->db_co_thread->st_dlog_buf.dlb_flush_log(TRUE, thread)) {1134 if (!xl_db->db_co_thread->st_dlog_buf.dlb_flush_log(TRUE, thread)) {
1135 xl_log_bytes_written -= part_size;
1135 xt_unlock_mutex_ns(&xl_db->db_co_dlog_lock);1136 xt_unlock_mutex_ns(&xl_db->db_co_dlog_lock);
1136 goto write_failed;1137 goto write_failed;
1137 }1138 }
@@ -1140,8 +1141,10 @@
11401141
1141 /* And flush if required: */1142 /* And flush if required: */
1142 flush_time = thread->st_statistics.st_xlog.ts_flush_time;1143 flush_time = thread->st_statistics.st_xlog.ts_flush_time;
1143 if (!xt_flush_file(xl_log_file, &thread->st_statistics.st_xlog, thread))1144 if (!xt_flush_file(xl_log_file, &thread->st_statistics.st_xlog, thread)) {
1145 xl_log_bytes_written -= part_size;
1144 goto write_failed;1146 goto write_failed;
1147 }
1145 xl_last_flush_time = (u_int) (thread->st_statistics.st_xlog.ts_flush_time - flush_time);1148 xl_last_flush_time = (u_int) (thread->st_statistics.st_xlog.ts_flush_time - flush_time);
11461149
1147 xl_log_bytes_flushed = xl_log_bytes_written;1150 xl_log_bytes_flushed = xl_log_bytes_written;
@@ -2514,9 +2517,6 @@
2514 if (!record) {2517 if (!record) {
2515 break;2518 break;
2516 }2519 }
2517 /* Count the number of bytes read from the log: */
2518 db->db_xlog.xl_log_bytes_read += ws->ws_seqread.xseq_record_len;
2519
2520 switch (record->xl.xl_status_1) {2520 switch (record->xl.xl_status_1) {
2521 case XT_LOG_ENT_HEADER:2521 case XT_LOG_ENT_HEADER:
2522 break;2522 break;
@@ -2540,6 +2540,8 @@
2540 xt_xres_apply_in_order(self, ws, ws->ws_seqread.xseq_rec_log_id, ws->ws_seqread.xseq_rec_log_offset, record);2540 xt_xres_apply_in_order(self, ws, ws->ws_seqread.xseq_rec_log_id, ws->ws_seqread.xseq_rec_log_offset, record);
2541 break;2541 break;
2542 }2542 }
2543 /* Count the number of bytes read from the log: */
2544 db->db_xlog.xl_log_bytes_read += ws->ws_seqread.xseq_record_len;
2543 }2545 }
2544 }2546 }
25452547

Subscribers

People subscribed via source and target branches