public PartitionMetadata read() {
        synchronized (lock) {
            try {
                try (BufferedReader reader = Files.newBufferedReader(path(), StandardCharsets.UTF_8)) {
                    PartitionMetadataReadBuffer partitionBuffer = new PartitionMetadataReadBuffer(file.getAbsolutePath(), reader);
                    return partitionBuffer.read();
                }
            } catch (IOException e) {
                String msg = "Error while reading partition metadata file " + file.getAbsolutePath();
                logDirFailureChannel.maybeAddOfflineLogDir(logDir(), msg, e);
                throw new KafkaStorageException(msg, e);
            }
        }
    }
Records the topic ID that will be flushed to disk.
storage/src/main/java/org/apache/kafka/storage/internals/checkpoint/PartitionMetadataFile.java