diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 97d0bf2..d2283ed 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -111,8 +111,12 @@ public function dump(array $options = array()) {
     // unstable router states due to random failures.
     $transaction = $this->connection->startTransaction();
     try {
-      $this->connection->delete($this->tableName)
-        ->condition('provider', $options['provider'])
+      $delete = $this->connection->delete($this->tableName);
+      $delete
+        ->condition($delete->orConditionGroup()
+          ->condition('provider', $options['provider'])
+          ->condition('name', array_keys($this->routes))
+        )
         ->execute();
       $insert->execute();
       // We want to reuse the dumper for multiple providers, so on dump, flush
