Merge lp:~vkolesnikov/pbxt/pbxt-index-recovery-problem into lp:pbxt

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

merged with upstream

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-06-03 14:53:00 +0000
3+++ ChangeLog 2009-06-09 15:06:41 +0000
4@@ -3,6 +3,8 @@
5
6 ------- 1.0.08 RC - Not yet released
7
8+RN244: Fixed a recovery problem: during the recovery of "record modified" action the table was updated before the old index entries were removed; then the xres_remove_index_entries was supplied the new record which lead to incorrect index update
9+
10 RN243: Fixed a bug that caused a recovery failure if partitioned pbxt tables where present. This happended because the recovery used a MySQL function to open tables and the PBXT handler was not yet registered
11
12 RN242: Fixed a bug that caused a deadlock if pbxt initialization failed. This happened because pbxt ceanup was done from pbxt_init() with PLUGIN_lock being held by MySQL which lead to a deadlock in the freeer thread
13
14=== modified file 'src/restart_xt.cc'
15--- src/restart_xt.cc 2009-06-03 14:07:54 +0000
16+++ src/restart_xt.cc 2009-06-09 15:06:41 +0000
17@@ -638,6 +638,15 @@
18 case XT_LOG_ENT_INSERT_BG:
19 case XT_LOG_ENT_DELETE_BG:
20 rec_id = XT_GET_DISK_4(record->xu.xu_rec_id_4);
21+
22+ /* This should be done before we apply change to table, as otherwise we lose
23+ * the key value that we need to remove from index
24+ */
25+ if (record->xl.xl_status_1 == XT_LOG_ENT_REC_MODIFIED) {
26+ if ((rec_data = xres_load_record(self, ot, rec_id, NULL, 0, rec_buf, tab->tab_dic.dic_ind_cols_req)))
27+ xres_remove_index_entries(ot, rec_id, rec_data);
28+ }
29+
30 len = (size_t) XT_GET_DISK_2(record->xu.xu_size_2);
31 if (!XT_PWRITE_RR_FILE(ot->ot_rec_file, xt_rec_id_to_rec_offset(tab, rec_id), len, (xtWord1 *) &record->xu.xu_rec_type_1, &ot->ot_thread->st_statistics.st_rec, ot->ot_thread))
32 xt_throw(self);
33@@ -648,10 +657,6 @@
34 case XT_LOG_ENT_DELETE:
35 case XT_LOG_ENT_DELETE_BG:
36 break;
37- case XT_LOG_ENT_REC_MODIFIED:
38- if ((rec_data = xres_load_record(self, ot, rec_id, NULL, 0, rec_buf, tab->tab_dic.dic_ind_cols_req)))
39- xres_remove_index_entries(ot, rec_id, rec_data);
40- /* No break required: */
41 default:
42 if ((rec_data = xres_load_record(self, ot, rec_id, &record->xu.xu_rec_type_1, len, rec_buf, tab->tab_dic.dic_ind_cols_req))) {
43 row_id = XT_GET_DISK_4(record->xu.xu_row_id_4);
44@@ -3197,13 +3202,13 @@
45
46 static void *xn_xres_run_recovery_thread(XTThreadPtr self)
47 {
48- THD *mysql_thread;
49-
50- mysql_thread = (THD *)myxt_create_thread();
51-
52- while(!ha_resolve_by_legacy_type(mysql_thread, DB_TYPE_PBXT))
53- xt_sleep_milli_second(1);
54-
55+ THD *mysql_thread;
56+
57+ mysql_thread = (THD *)myxt_create_thread();
58+
59+ while(!ha_resolve_by_legacy_type(mysql_thread, DB_TYPE_PBXT))
60+ xt_sleep_milli_second(1);
61+
62 xt_open_database(self, mysql_real_data_home, TRUE);
63 pbxt_database = self->st_database;
64 xt_heap_reference(self, pbxt_database);

Subscribers

People subscribed via source and target branches