/* Save the previous link because once we free the
@@ -628,9 +629,6 @@ rescan:
/* Remove was unsuccessful, we have to try again
by scanning the entire list from the end.
- This also means that we never released the
- flust list mutex. Therefore we can trust the prev
- pointer.
buf_flush_or_remove_page() released the
flush list mutex but not the LRU list mutex.
Therefore it is possible that a new page was
@@ -647,6 +645,12 @@ rescan:
iteration. */
all_freed = false;
+
+ if (UNIV_UNLIKELY(must_restart)) {
+
+ /* cannot trust the prev pointer */
+ break;
+ }
} else if (flush) {
/* The processing was successful. And during the
@@ -654,10 +658,6 @@ rescan:
when calling buf_page_flush(). We cannot trust
prev pointer. */
goto rescan;
- } else if (UNIV_UNLIKELY(must_restart)) {
-
- ut_ad(!all_freed);
- break;
}
++processed;
@@ -670,6 +670,11 @@ rescan:
/* Reset the batch size counter if we had to yield. */
Tentative 5.7 fix
diff --git a/storage/ innobase/ buf/buf0lru. cc b/storage/ innobase/ buf/buf0lru. cc innobase/ buf/buf0lru. cc innobase/ buf/buf0lru. cc
index b76607d..db63ccb 100644
--- a/storage/
+++ b/storage/
@@ -608,6 +608,7 @@ rescan:
bpage != NULL;
bpage = prev) {
+ ut_ad(! must_restart) ; buf_page_ in_file( bpage)) ;
ut_a(
/* Save the previous link because once we free the
@@ -628,9 +629,6 @@ rescan:
/* Remove was unsuccessful, we have to try again flush_or_ remove_ page() released the
by scanning the entire list from the end.
- This also means that we never released the
- flust list mutex. Therefore we can trust the prev
- pointer.
buf_
flush list mutex but not the LRU list mutex.
Therefore it is possible that a new page was
@@ -647,6 +645,12 @@ rescan:
iteration. */
all_freed = false; must_restart) ) {
+
+ if (UNIV_UNLIKELY(
+
+ /* cannot trust the prev pointer */
+ break;
+ }
} else if (flush) {
/* The processing was successful. And during the must_restart) ) {
@@ -654,10 +658,6 @@ rescan:
when calling buf_page_flush(). We cannot trust
prev pointer. */
goto rescan;
- } else if (UNIV_UNLIKELY(
-
- ut_ad(!all_freed);
- break;
}
++processed;
@@ -670,6 +670,11 @@ rescan:
/* Reset the batch size counter if we had to yield. */
processed = 0; must_restart) ) {
+ } else if (UNIV_UNLIKELY(
+
+ /* Cannot trust prev pointer now */
+ all_freed = false;
+ break;
}
#ifdef DBUG_OFF