diff --git a/core/includes/common.inc b/core/includes/common.inc
index 5d88545..a483f8d 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1737,6 +1737,7 @@ function drupal_flush_all_caches() {
   foreach (Cache::getBins() as $service_id => $cache_backend) {
     $cache_backend->deleteAll();
   }
+  \Drupal::service('cache_tags.invalidator.checksum')->resetTagInvalidations();
 
   // Flush asset file caches.
   \Drupal::service('asset.css.collection_optimizer')->deleteAll();
diff --git a/core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php b/core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php
index c9e3ff0..445d8f3 100644
--- a/core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php
+++ b/core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php
@@ -54,6 +54,13 @@ public function getCurrentChecksum(array $tags);
   public function isValid($checksum, array $tags);
 
   /**
+   * Clear all stored cache tag invalidations.
+   *
+   * Called after clearing all stored caches.
+   */
+  public function resetTagInvalidations();
+
+  /**
    * Reset statically cached tags.
    *
    * This is only used by tests.
diff --git a/core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php b/core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php
index b6d9161..2b1572d 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php
@@ -132,6 +132,14 @@ public function calculateChecksum(array $tags) {
   /**
    * {@inheritdoc}
    */
+  public function resetTagInvalidations() {
+    $this->connection->truncate('cachetags')->execute();
+    $this->reset();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function reset() {
     $this->tagCache = array();
     $this->invalidatedTags = array();
