Think of the BI clusters as logically being in a ring (linked list):
Code:
--> cluster 0 --> cluster 1 --> cluster 2 --> cluster 3 --> cluster 4 --> ... --> cluster n --
| |
----------------------------------------------------------------------------------------------
Notes are only added, in chronological order, to the current cluster. When it fills, the current cluster is closed and new writes will go to the "next" cluster in the ring. Which one is next? Imagine that cluster 2 is the currently-open BI cluster. BI notes are written to it until it fills. Then a decision is required: can we write new notes to cluster 3, the next one in the ring? If cluster 3 contains no notes that are related to active transactions or to changes that have not yet been committed to disk in the database then the notes in cluster 3 are no longer needed and its space can be re-used. New BI notes are written to cluster 3. But if cluster 3 cannot be re-used, for the reasons given above, then a new cluster must be formatted and inserted into the ring (logically, not physically) between 2 and 3 and new BI notes are written into it. When it fills, the process above repeats itself. I have simplified somewhat but that is the basic process. Gus does a very good job of explaining the process (and a bunch of other interesting DB internals stuff)
in this video.