The rotations of binlogs weren't detected as the file names weren't compared. Moved the indexing of the binlogs to the end of the binlog processing. This way the files can be flushed multiple times before they are indexed.