Chapter 24. Resolving Common Issues
This chapter provides some of the Red Hat Gluster Storage troubleshooting methods.
24.1. Identifying locked file and clear locks Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can use the
statedump
command to list the locks held on files. The statedump
output also provides information on each lock with its range, basename, and PID of the application holding the lock, and so on. You can analyze the output to find the locks whose owner/application is no longer running or interested in that lock. After ensuring that no application is using the file, you can clear the lock using the following clear-locks
command:
# gluster volume clear-locks VOLNAME path kind {blocked | granted | all}{inode range | entry basename | posix range}
For more information on performing
statedump
, see Section 19.8, “Viewing complete volume state with statedump”
To identify locked file and clear locks
- Perform
statedump
on the volume to view the files that are locked using the following command:# gluster volume statedump VOLNAME
For example, to displaystatedump
of test-volume:gluster volume statedump test-volume
# gluster volume statedump test-volume Volume statedump successful
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Thestatedump
files are created on the brick servers in the/tmp
directory or in the directory set using theserver.statedump-path
volume option. The naming convention of the dump file isbrick-path.brick-pid.dump
. - Clear the entry lock using the following command:
# gluster volume clear-locks VOLNAME path kind granted entry basename
The following are the sample contents of thestatedump
file indicating entry lock (entrylk). Ensure that those are stale locks and no resources own them.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to clear the entry lock onfile1
of test-volume:gluster volume clear-locks test-volume / kind granted entry file1
# gluster volume clear-locks test-volume / kind granted entry file1 Volume clear-locks successful test-volume-locks: entry blocked locks=0 granted locks=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Clear the inode lock using the following command:
# gluster volume clear-locks VOLNAME path kind granted inode range
The following are the sample contents of thestatedump
file indicating there is an inode lock (inodelk). Ensure that those are stale locks and no resources own them.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to clear the inode lock onfile1
of test-volume:gluster volume clear-locks test-volume /file1 kind granted inode 0,0-0
# gluster volume clear-locks test-volume /file1 kind granted inode 0,0-0 Volume clear-locks successful test-volume-locks: inode blocked locks=0 granted locks=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Clear the granted POSIX lock using the following command:
# gluster volume clear-locks VOLNAME path kind granted posix range
The following are the sample contents of thestatedump
file indicating there is a granted POSIX lock. Ensure that those are stale locks and no resources own them.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to clear the granted POSIX lock onfile1
of test-volume:gluster volume clear-locks test-volume /file1 kind granted posix 0,8-1
# gluster volume clear-locks test-volume /file1 kind granted posix 0,8-1 Volume clear-locks successful test-volume-locks: posix blocked locks=0 granted locks=1 test-volume-locks: posix blocked locks=0 granted locks=1 test-volume-locks: posix blocked locks=0 granted locks=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Clear the blocked POSIX lock using the following command:
# gluster volume clear-locks VOLNAME path kind blocked posix range
The following are the sample contents of thestatedump
file indicating there is a blocked POSIX lock. Ensure that those are stale locks and no resources own them.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to clear the blocked POSIX lock onfile1
of test-volume:gluster volume clear-locks test-volume /file1 kind blocked posix 0,0-1
# gluster volume clear-locks test-volume /file1 kind blocked posix 0,0-1 Volume clear-locks successful test-volume-locks: posix blocked locks=28 granted locks=0 test-volume-locks: posix blocked locks=1 granted locks=0 No locks cleared.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Clear all POSIX locks using the following command:
# gluster volume clear-locks VOLNAME path kind all posix range
The following are the sample contents of thestatedump
file indicating that there are POSIX locks. Ensure that those are stale locks and no resources own them.Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to clear all POSIX locks onfile1
of test-volume:gluster volume clear-locks test-volume /file1 kind all posix 0,0-1
# gluster volume clear-locks test-volume /file1 kind all posix 0,0-1 Volume clear-locks successful test-volume-locks: posix blocked locks=1 granted locks=0 No locks cleared. test-volume-locks: posix blocked locks=4 granted locks=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can perform
statedump
on test-volume again to verify that all the above locks are cleared.