Julian Chandra Sutadi created HBASE-30521:
---------------------------------------------
Summary: BlockCacheUtil JSON serializer includes transient
BucketCache internals
Key: HBASE-30521
URL: https://issues.apache.org/jira/browse/HBASE-30521
Project: HBase
Issue Type: Bug
Reporter: Julian Chandra Sutadi
HBASE-29215 fixed the block cache JSON view for {{BucketCache}} by marking the
cache internals (e.g. {{backingMap}}, {{ioEngine}}) {{transient}}, which Gson
excludes by default.
HBASE-29325 later changed the serializer in {{BlockCacheUtil}} to
{{excludeFieldsWithModifiers(Modifier.PRIVATE)}}. In [PR
#6999|https://github.com/apache/hbase/pull/6999], excluding {{TRANSIENT}} and
{{STATIC}} explicitly was dropped since they are Gson's default exclusions.
However, {{excludeFieldsWithModifiers}} overrides those defaults rather than
adding to them, so the non-private transient fields are serialized again. For
example, {{BucketCache.backingMap}}, which holds an entry for every cached
block, is included, so the size of the JSON view grows with the number of
cached blocks. This is the concern about serializing the whole BucketCache
raised in the same PR.
The suggested fix is to pass the defaults along with {{PRIVATE}}, i.e.
{{excludeFieldsWithModifiers(Modifier.PRIVATE, Modifier.TRANSIENT,
Modifier.STATIC)}}. We will submit the fix proposal soon.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)