Log in
Model

ActiveTableSwitcher

Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher

What it does

This class manages the switching of Magento 2 index tables between active and replica versions during reindexing operations.

Developers use this when implementing custom indexers that need to perform atomic table switches to ensure zero downtime during index updates.

It handles the table renaming logic that swaps the working replica table with the active table, allowing users to continue browsing while indexes are being rebuilt.

Public Methods

  • switchTable()
  • getAdditionalTableName()