diff --git a/core/modules/comment/src/Tests/CommentUninstallTest.php b/core/modules/comment/src/Tests/CommentUninstallTest.php
index ad98d68..948e68d 100644
--- a/core/modules/comment/src/Tests/CommentUninstallTest.php
+++ b/core/modules/comment/src/Tests/CommentUninstallTest.php
@@ -83,6 +83,21 @@ function testCommentUninstallWithoutField() {
     // Ensure that uninstallation succeeds even if the field has already been
     // deleted manually beforehand.
     $this->container->get('module_installer')->uninstall(array('comment'));
-  }
 
+    // Ensure that all field data for comment module has been removed from the
+    // schema.
+    $key_value_store = \Drupal::keyValue('entity.storage_schema.sql');
+    $schema = $key_value_store->getAll();
+    $item_count = 0;
+
+    foreach ($schema as $item_name => $item) {
+      $entity_item = substr($item_name, 0, strpos($item_name, '.'));
+      if($entity_item == 'comment') {
+        $item_count++;
+      }
+    }
+
+    $this->assertEqual($item_count, 0, 'After uninstallation the schema' .
+      'still contains fields for the the comment entity.');
+  }
 }
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index a8477d3..3df3ec4 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1424,3 +1424,21 @@ function system_path_insert() {
 function system_path_delete($path) {
   \Drupal::service('path.alias_manager')->cacheClear();
 }
+
+/**
+ * Implements hook_modues_uninstalled().
+ */
+function system_modules_uninstalled($modules) {
+  // Clean the storage schema of entities that are gone because their modules
+  // were uninstalled.
+  $key_value_store = \Drupal::keyValue('entity.storage_schema.sql');
+  $schema = $key_value_store->getAll();
+  $entities = array_keys(Drupal::entityManager()->getDefinitions());
+
+  foreach ($schema as $item_name => $item) {
+    $entity_item = substr($item_name, 0, strpos($item_name, '.'));
+    if(!in_array($entity_item, $entities)) {
+      $key_value_store->delete($item_name);
+    }
+  }
+}
