diff --git a/src/Entity/Index.php b/src/Entity/Index.php
index f0fe8938..96b1819a 100644
--- a/src/Entity/Index.php
+++ b/src/Entity/Index.php
@@ -1146,7 +1146,9 @@ class Index extends ConfigEntityBase implements IndexInterface {
    */
   protected function setHasReindexed($has_reindexed = TRUE) {
     $id = $this->id();
-    \Drupal::state()->set("search_api.index.$id.has_reindexed", $has_reindexed);
+    if ($this->isReindexing() !== $has_reindexed) {
+      \Drupal::state()->set("search_api.index.$id.has_reindexed", $has_reindexed);
+    }
     return $this;
   }
 
