- $this->mainRoleId = MediaWikiServices::getInstance()->getSlotRoleStore()
- ->acquireId( SlotRecord::MAIN );
+
+ // Don't trust the cache for the NameTableStores, in case something went
+ // wrong during a previous run (see T224949#5325895).
+ $this->contentModelStore->reloadMap();
+ $this->slotRoleStore->reloadMap();
+ $this->mainRoleId = $this->slotRoleStore->acquireId( SlotRecord::MAIN );