Meta server: implement transaction log "set file system info" entry, and corresponding op. Emit set file system info transaction log entry when converting the file system with no file system id, i.e. assigning file system id on startup. Doing so is required to correctly handle meta server shutdown/exit prior to writing the next checkpoint file, followed by restart. With no "set file system id" transaction log entry a new, yet another, file system id will be assigned to the file system, while the chunk servers will still / have the previously assigned file system id. The same problem would arise in the case if the log segment with "set file system info" entry is "lost" prior to writing checkpoint file. The manual recovery in such case requires adding "set file system info" log entry to the last partial segment with the file system id set to the file system id used by the chunk servers.
Chunk server: implement file system id handling. Add file system id to chunk file header, by storing file system id into unused "name" field of the chunk header. Use distinct file system id field prefix with leading 0 and trailing 8 bytes generated by a random number generator to handle the case when the name field was used or if it wasn't reset to 0. Both these are extremely unlikely though: the filed is reset to 0 in the last 5 or so years. Compare chunk's file system id against file system id set by the meta server when loading and verifying chunk headers, declare error and report chunk lost to the meta server in the case of file system id mismatch. Change chunk directory checker to extract file system id from 1/32 of the chunk files in the chunk directory and the file the largest chunk id. Add file system id file to the chunk directory -- the file with file system id prefix ("0-fsid-" is the default) followed by the file system id in decimal notation. This file is intended primarily for backward compatibility / conversion / assigning file system id, so that the chunks with no file system id filed in the chunk header can be used. Do not use chunk directory and report error in the case if file system id in the chunk directory is not consistent. Implement file system id re-assignment with chunk files cleanup with chunk directory checker. Use the most "frequent"  file system id in the case if file system ids of different chunk directories doesn't match, and add back into chunk directory checker the chunk directories that have non matching file system id. Report file system id to the meta server via chunk server hello. Implement handling of the meta server hello response that can possibly instruct the chunk server to discard all chunks in the case of file system id mismatch, by setting file system id with chunk directory checker and moving back to the chunk directory checker chunk directories that have non matching file system ids.