anmolnar opened a new pull request, #8857:
URL: https://github.com/apache/hbase/pull/8857

   MetricsIO.getInstance() lazily registers the "RegionServer,sub=IO" metrics 
source on the first HFile read or write. Hadoop's MetricsSystemImpl.register() 
reserves the source name before registration has fully completed, so if 
anything fails after that point the singleton is never assigned and every later 
call fails with "Metrics source RegionServer,sub=IO already exists!". This 
breaks all HFile reads and writes for the rest of the JVM's life, as seen in a 
bulk load client splitting HFiles in LoadIncrementalHFiles.
   
   - If creating the source fails, log a warning once and use a MetricsIO 
backed by a no-op MetricsIOSource, so a metrics problem can never fail HFile 
I/O.
   - Make IO metrics opt-in: MetricsIO.getInstance() returns a shared no-op 
instance until MetricsIO.enable() is called, which HRegionServer does in its 
constructor, covering HMaster too since it extends HRegionServer (the master 
reads and writes HFiles through its local MasterRegion). Clients and tools that 
read or write HFiles (bulk load, MapReduce and Spark tasks, HFilePrettyPrinter, 
...) no longer start the Hadoop metrics system or register a RegionServer 
source. The real source is still created lazily on first use (HBASE-27966), so 
server behavior is unchanged.
   
   Co-Authored-By: Claude Opus 5.5 <[email protected]>
   
   Signed-off-by: Wellington Chevreuil <[email protected]>
   Signed-off-by: Xiao Liu <[email protected]>
   Signed-off-by: David Paksy <[email protected]>
   
   (cherry picked from commit 242e81effc6c00d68e533f0f141809a63a3d01dc)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to