Merge lp:~vkolesnikov/pbxt/pbxt-07-low-disk-index-flush into lp:pbxt/1.0.07-rc
Proposed by
Vladimir Kolesnikov
Status: | Rejected |
---|---|
Rejected by: | Paul McCullagh |
Proposed branch: | lp:~vkolesnikov/pbxt/pbxt-07-low-disk-index-flush |
Merge into: | lp:pbxt/1.0.07-rc |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~vkolesnikov/pbxt/pbxt-07-low-disk-index-flush |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul McCullagh | Abstain | ||
Review via email: mp+10141@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 559. By Vladimir Kolesnikov
-
more improvements for the index flush fix
- 558. By Vladimir Kolesnikov
-
out-of-disk handling improvements: keep and retry ilog
- 557. By Vladimir Kolesnikov
-
updated version to 1.0.07r
- 556. By Vladimir Kolesnikov
-
updated ChangeLog
- 555. By Vladimir Kolesnikov
-
fixed an checkpointer index flush problem when running out of disk space
Hi Vlad,
There is a problem with this change. Actually a serious bug.
See below:
On Aug 14, 2009, at 11:30 AM, Vladimir Kolesnikov wrote:
> Vladimir Kolesnikov has proposed merging lp:~vkolesnikov/pbxt/ low-disk- index-flush into lp:pbxt/1.0.07-rc. /code.launchpad .net/~vkolesnik ov/pbxt/ pbxt-07- low-disk- index- PAGE_SIZE) ; ind_flush_ seq; ind_flush_ seq++; dic.dic_ keys; NS(block- >cp_flush_ seq == curr_flush_seq) ind_flush_ seq++; dic.dic_ keys; tab_dic. dic_key_ count; i++, indp++) {
> pbxt-07-
>
> Requested reviews:
> PBXT Core (pbxt-core)
> --
> https:/
> flush/+merge/10141
> Your team PBXT Core is subscribed to branch lp:pbxt/1.0.07-rc.
> === modified file 'ChangeLog'
> --- ChangeLog 2009-08-11 09:17:53 +0000
> +++ ChangeLog 2009-08-14 09:23:20 +0000
> @@ -1,6 +1,10 @@
> PBXT Release Notes
> ==================
>
> +------- 1.0.07r RC - 2009-08-14
> +
> +RN267: Fixed an assertion failure: if checkpointer failed to
> successully flush indices (e.g. due to low disk state) then next
> time xt_flush_indices is called it would generate an assertion failure
> +
> RN266: Fixed a crash: when initialization failed with an exception
> THD structure was released twice
>
> ------- 1.0.07q RC - 2009-08-09
>
> === modified file 'src/index_xt.cc'
> --- src/index_xt.cc 2009-07-07 14:21:07 +0000
> +++ src/index_xt.cc 2009-08-13 13:49:21 +0000
> @@ -2785,7 +2785,6 @@
> *bytes_flushed += (dirty_blocks * XT_INDEX_
>
> curr_flush_seq = tab->tab_
> - tab->tab_
>
> /* Write the dirty pages: */
> indp = tab->tab_
> @@ -2981,6 +2980,13 @@
> }
> }
>
> + /* At this point all dirty blocks should have been successully
> flushed to disk,
> + * otherwise we must not increment this value as an assertion
> above in this
> + * function ASSERT_
> + * will fail.
> + */
> + tab->tab_
> +
> indp = tab->tab_
> for (i=0; i<tab->
> ind = *indp;
I think you have moved tab_ind_flush_seq++ too far down. All locks on
the index are released before the if (wrote_something) block:
indp = tab->tab_ dic.dic_ keys; tab_dic. dic_key_ count; i++, indp++) { UNLOCK( ind, ot);
for (i=0; i<tab->
ind = *indp;
XT_INDEX_
}
if (wrote_something) {
....
After that point, the index can be updated again. Then it is important
that the updates use a different flush sequence number. If not, the
page will be freed by the code that occurred just above this point:
/* Free up flushed pages: */ dic.dic_ keys; tab_dic. dic_key_ count; i++, indp++) {
. ..
indp = tab->tab_
for (i=0; i<tab->
And the changes in the cache will be lost!
> inc4(volatile xtWord4 *mptr) XT_ATOMIC_ GNUC_X86) XT_ATOMIC_ GCC_OPS) fetch_and_ add(mptr, 1); XT_ATOMIC_ SOLARIS_ LIB) inc_32_ nv(mptr) ;
> === modified file 'src/lock_xt.h'
> --- src/lock_xt.h 2008-11-17 10:14:17 +0000
> +++ src/lock_xt.h 2009-08-13 13:49:21 +0000
> @@ -234,6 +234,38 @@
> return val;
> }
>
> +inline void xt_atomic_
> +{
> +#ifdef XT_ATOMIC_WIN32_X86
> + __asm MOV ECX, mptr
> + __asm LOCK INC DWORD PTR [ECX]
> +#elif defined(
> + asm volatile ("lock; incl %0" : : "m" (*mptr) : "memory");
> +#elif defined(
> + __sync_
> +#elif defined(
> + atomic_
> +#else
> + ++(*mptr);
> +#endif
> +}
> +
> +inline void x...