Code review comment: Because size must be 0, any number XOR 0 is equal to any number, so no calculation is needed here.

Code under review:
public long loadAlterJob(DataInputStream dis, long checksum, AlterJobV2.JobType type) throws IOException {
        Map<Long, AlterJobV2> alterJobsV2 = Maps.newHashMap();
        if (type == AlterJobV2.JobType.SCHEMA_CHANGE) {
            alterJobsV2 = this.getSchemaChangeHandler().getAlterJobsV2();
        }

        
        int size = dis.readInt();
        if (size > 0) {
            
            throw new RuntimeException("Old metadata was found, please upgrade to version 2.4 first " +
                    "and then from version 2.4 to the current version.");
        }

        if (GlobalStateMgr.getCurrentStateJournalVersion() >= 2) {
            
            size = dis.readInt();
            if (size > 0) {
                
                throw new RuntimeException("Old metadata was found, please upgrade to version 2.4 first " +
                        "and then from version 2.4 to the current version.");
            }
        }

        long newChecksum = checksum;
        
        if (GlobalStateMgr.getCurrentStateJournalVersion() >= FeMetaVersion.VERSION_61) {
            size = dis.readInt();
            newChecksum ^= size;
            for (int i = 0; i < size; i++) {
                AlterJobV2 alterJobV2 = AlterJobV2.read(dis);
                if (type == AlterJobV2.JobType.ROLLUP || type == AlterJobV2.JobType.SCHEMA_CHANGE) {
                    if (type == AlterJobV2.JobType.ROLLUP) {
                        this.getRollupHandler().addAlterJobV2(alterJobV2);
                    } else {
                        alterJobsV2.put(alterJobV2.getJobId(), alterJobV2);
                    }
                    
                    
                    
                    if (alterJobV2.getJobState() == AlterJobV2.JobState.PENDING) {
                        alterJobV2.replay(alterJobV2);
                        LOG.info("replay pending alter job when load alter job {} ", alterJobV2.getJobId());
                    }
                } else {
                    alterJobsV2.put(alterJobV2.getJobId(), alterJobV2);
                }
            }
        }

        return newChecksum;
    }

Line commented on: long newChecksum = checksum;

Revised code:
public long loadAlterJob(DataInputStream dis, long checksum, AlterJobV2.JobType type) throws IOException {
        
        int size = dis.readInt();
        if (size > 0) {
            
            throw new RuntimeException("Old metadata was found, please upgrade to version 2.4 first " +
                    "and then from version 2.4 to the current version.");
        }

        if (GlobalStateMgr.getCurrentStateJournalVersion() >= 2) {
            
            size = dis.readInt();
            if (size > 0) {
                
                throw new RuntimeException("Old metadata was found, please upgrade to version 2.4 first " +
                        "and then from version 2.4 to the current version.");
            }
        }

        long newChecksum = checksum;
        
        if (GlobalStateMgr.getCurrentStateJournalVersion() >= FeMetaVersion.VERSION_61) {
            size = dis.readInt();
            newChecksum ^= size;
            for (int i = 0; i < size; i++) {
                AlterJobV2 alterJobV2 = AlterJobV2.read(dis);
                if (type == AlterJobV2.JobType.ROLLUP || type == AlterJobV2.JobType.SCHEMA_CHANGE) {
                    if (type == AlterJobV2.JobType.ROLLUP) {
                        this.getRollupHandler().addAlterJobV2(alterJobV2);
                    } else {
                        this.getSchemaChangeHandler().addAlterJobV2(alterJobV2);
                    }
                    
                    
                    
                    if (alterJobV2.getJobState() == AlterJobV2.JobState.PENDING) {
                        alterJobV2.replay(alterJobV2);
                        LOG.info("replay pending alter job when load alter job {} ", alterJobV2.getJobId());
                    }
                } else {
                    LOG.warn("Unknown job type:" + type.name());
                }
            }
        }

        return newChecksum;
    }