The REPEATABLE_READ isolation level defines that if a transaction reads one record from the database multiple times, the results of all of those reading operations must be the same. This isolation helps us to prevent issues like dirty reads and non-repeatable reads, but it may create another issue.
Let's see the following diagram:
In this example, Transaction A reads a range of data. Simultaneously, Transaction B inserts new data in the same range that Transaction A initially fetched and commits. Later, Transaction A reads the same range again and will also get the record that Transaction B just inserted. This is a phantom ...