Skip to content

HBASE-30346: Fix NPE in AbstractFSWAL WAL-roll debug logging aborting… - #8580

Open
mnpoonia wants to merge 1 commit into
apache:masterfrom
mnpoonia:HBASE-30346-getpipeline-npe
Open

HBASE-30346: Fix NPE in AbstractFSWAL WAL-roll debug logging aborting…#8580
mnpoonia wants to merge 1 commit into
apache:masterfrom
mnpoonia:HBASE-30346-getpipeline-npe

Conversation

@mnpoonia

Copy link
Copy Markdown
Contributor

… RegionServer

FSHLog#getPipeline() delegated directly to Hadoop's DFSOutputStream#getPipeline(), which can legitimately return null (streamer closed, or no block pipeline currently established between blocks). The debug logging added in HBASE-28775 replaced the null-tolerant Arrays.toString(...) with Arrays.stream(...), which throws NPE on null, turning a benign transient HDFS state into a RegionServer self-abort during WAL rolling -- even though the roll itself had already succeeded.

Normalize FSHLog#getPipeline() to never return null (an empty array instead), matching the contract AsyncFSWAL#getPipeline() already honors.

… RegionServer

FSHLog#getPipeline() delegated directly to Hadoop's
DFSOutputStream#getPipeline(), which can legitimately return null (streamer
closed, or no block pipeline currently established between blocks). The debug
logging added in HBASE-28775 replaced the null-tolerant Arrays.toString(...)
with Arrays.stream(...), which throws NPE on null, turning a benign transient
HDFS state into a RegionServer self-abort during WAL rolling -- even though
the roll itself had already succeeded.

Normalize FSHLog#getPipeline() to never return null (an empty array instead),
matching the contract AsyncFSWAL#getPipeline() already honors.
@mnpoonia
mnpoonia force-pushed the HBASE-30346-getpipeline-npe branch from 7c2d364 to 1ecc0f5 Compare August 31, 2026 07:23
@mnpoonia

Copy link
Copy Markdown
Contributor Author

Need help in triggering the workflow.
@virajjasani @Apache9 @apurtell FYI

@Apache9

Apache9 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This only happens for FSHLog?

@mnpoonia

Copy link
Copy Markdown
Contributor Author

This only happens for FSHLog?

Yes — this is FSHLog-only.

FSHLog#getPipeline() delegated directly to Hadoop's DFSOutputStream#getPipeline(), which can legitimately return null (streamer closed, or no block pipeline currently established) — that's the
crash site.

AsyncFSWAL#getPipeline() is unaffected:

DatanodeInfo[] getPipeline() {
  return output != null ? output.getPipeline() : new DatanodeInfo[0];
}

where output is one of:

  • FanOutOneBlockAsyncDFSOutput#getPipeline() → returns locations, set once in the constructor and never nulled
  • WrapperAsyncFSOutput#getPipeline() → always returns new DatanodeInfo[0]

Neither can return null, and AsyncFSWAL already null-guards the output reference itself. So only the sync WAL implementation (FSHLog) could propagate a null pipeline into the null-intolerant
Arrays.stream(...) call — AsyncFSWAL was never at risk.

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.

5 participants