Skip to content

HBASE-30221 FNFE may occur when executing hbase snapshot info --list-snapshots#8340

Open
guluo2016 wants to merge 2 commits into
apache:masterfrom
guluo2016:hbase_HBASE-30221
Open

HBASE-30221 FNFE may occur when executing hbase snapshot info --list-snapshots#8340
guluo2016 wants to merge 2 commits into
apache:masterfrom
guluo2016:hbase_HBASE-30221

Conversation

@guluo2016

Copy link
Copy Markdown
Member

Details see: HBASE-30221

if (!fs.exists(snapshotDir)) {
return Collections.emptyList();
}
FileStatus[] snapshots = fs.listStatus(snapshotDir,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to test whether snapshots is null or empty, so we can save on request to HDFS namenode?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks.
I checked the code again and luckily found that CommonFSUtils.listStatus can handle this case directly, so let me update the code, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants