Skip to content

Commit 0bbcd92

Browse files
committed
add waring to format-namenode script
1 parent a60f157 commit 0bbcd92

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

rust/operator-binary/src/container.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,16 @@ impl ContainerConfig {
709709
710710
if [ ! -f "{NAMENODE_ROOT_DATA_DIR}/current/VERSION" ]
711711
then
712+
# Sanity check for data corruption: VERSION file exists but no fsimage_xxx files were created.
713+
FSIMAGE_COUNT=$(find "{NAMENODE_ROOT_DATA_DIR}/current" -maxdepth 1 -regextype posix-egrep -regex ".*/fsimage_[0-9]+" | wc -l)
714+
715+
if [ "${{FSIMAGE_COUNT}}" -eq 0 ]
716+
then
717+
echo "WARNING: {NAMENODE_ROOT_DATA_DIR}/current/VERSION file exists but no fsimage file(s) found."
718+
echo "This indicates an incomplete and corrupted namenode formatting. Please check the troubleshooting guide.
719+
exit 1
720+
fi
721+
712722
if [ -z ${{ACTIVE_NAMENODE+x}} ]
713723
then
714724
echo "No active namenode found. Formatting $POD_NAME as active."

0 commit comments

Comments
 (0)