|
1 | 1 | /* |
2 | | - Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
| 2 | + Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
@@ -1959,6 +1959,24 @@ Dbtup::disk_restart_alloc_extent(EmulatedJamBuffer* jamBuf, |
1959 | 1959 | ndbassert(old.p->m_free_matrix_pos == RNIL); |
1960 | 1960 | Uint32 pos= alloc.calc_extent_pos(old.p); |
1961 | 1961 | Local_extent_info_list new_list(c_extent_pool, alloc.m_free_extents[pos]); |
| 1962 | +#if defined VM_TRACE || defined ERROR_INSERT |
| 1963 | + ndbrequire(!"Bug17665497: debugging suspect code path."); |
| 1964 | + /** |
| 1965 | + * old is already in list with head alloc.m_extent_list. |
| 1966 | + * Before adding it to new_list it should be removed from |
| 1967 | + * previous list. Otherwise that list will become corrupt |
| 1968 | + * and Dbtup::disk_page_get_allocated() will eventually |
| 1969 | + * calculate wrong free value. Possibly it could also end |
| 1970 | + * up with derefering a released Extent_info. |
| 1971 | + * |
| 1972 | + * Something like below should be added, but since list is |
| 1973 | + * single linked remove is harder, might need to make list |
| 1974 | + * double linked. |
| 1975 | + * |
| 1976 | + * Local_fragment_extent_list list1(c_extent_pool, alloc.m_extent_list); |
| 1977 | + * list1.remove(old); |
| 1978 | + */ |
| 1979 | +#endif |
1962 | 1980 | new_list.addFirst(old); |
1963 | 1981 | old.p->m_free_matrix_pos= pos; |
1964 | 1982 | } |
@@ -2023,6 +2041,9 @@ Dbtup::disk_page_get_allocated(const Tablerec* tabPtrP, |
2023 | 2041 | Ptr<Extent_info> extentPtr; |
2024 | 2042 | for (list.first(extentPtr); !extentPtr.isNull(); list.next(extentPtr)) |
2025 | 2043 | { |
| 2044 | +#if defined VM_TRACE || defined ERROR_INSERT |
| 2045 | + ndbrequire(extentPtr.p->m_free_matrix_pos == RNIL); |
| 2046 | +#endif |
2026 | 2047 | cnt++; |
2027 | 2048 | free += extentPtr.p->m_free_space; |
2028 | 2049 | } |
|
0 commit comments