# Goal

GC cdc logs for a certain table if all shards have processed that log file.

## Sub goal 1

In this sub goal, you need to write a function that can be called manually. It is like the following, but you can add necessary parameters.

```
impl ShardTaskManager {
    pub fn gc_cdc_files_by_table(keyspace_id: u32, table_id: i64) {
        ...
    }
}
```

Note we don't include index_id here, because there could be many indices created under the same table_id. So we can only gc the cdc logs if all these indices have all consumed a certain cdc log.

Because partition tables may have their partition_id encoded in the prefix of cdc log file name, check `components/tici_common/src/cdc_file_name.rs`, so they are gc-ed seperately.

### Programming Style

You must follow `STYLE.md`.

### Musts

- All previous cdc log files before `CDC00000000000000000011.json` have been gc-ed if and only if all shards in this table have all processed the file, and advanced to process the next file, which in this case, should be `CDC00000000000000000012.json`.
- You have to pay extra attention that there could be multiple indices created under the same table, so they may share the same cdc prefix.

### Tests

You must implement tests to ensure that the "Musts" are met. You must follow the "Testing Guidelines" in `AGENTS.md`.

For all tests, you must check that the cdc logs have already been deleted by listing from S3, and you should check that following writes and reads can be performed correctly.

You have to implement a integration test to ensure the behevior that if there are 2 indices created under the same table.

You do not need to run the integration test yourself. Give me the command, I will run for you.

## Reviews

