Why full compaction skip some groups, after skip those groups ,the tsm files would never be same generation.

When i check my influxdb full compactions, i found some shards were not in same genration after long time when the shards became cold.

I checked codes and found those codes:

// Skip the file if it's over the max size and contains a full block and it does not have any tombstones
    if len(generations) > 2 && group.size() > uint64(maxTSMFileSize) && c.FileStore.BlockCount(group.files[0].Path, 1) == tsdb.DefaultMaxPointsPerBlock && !group.hasTombstones() {
        skip = true

After my tests, I found that in full compaction, many generations and tsm files were skiped in Plan(lastWrite time.Time) funcation. I can’t understand those codes.

I want to get all tsm files to become same generation. how?

My take is that line looks to be an optimization to skipping the file as it’s deemed already fine / no point it trying to compact it.

Are you dealing with very short or very long shards or something ? What other problem is created if they aren’t the same generation?