Skip to content

HBASE-28468: Integration of time-based priority caching in eviction logic. - #5826

Closed
jhungund wants to merge 1 commit into
apache:HBASE-28463from
janardhanrh:HBASE-28468_2
Closed

HBASE-28468: Integration of time-based priority caching in eviction logic.#5826
jhungund wants to merge 1 commit into
apache:HBASE-28463from
janardhanrh:HBASE-28468_2

Conversation

@jhungund

Copy link
Copy Markdown
Contributor

HBASE-28468: Integration of time-based priority caching in eviction logic.

The time-based priority caching relies on the presence of file paths in the block-cache key.
However, in case of the persitent cache, the file paths are not persisted in the files.

Hence, when the region server is restarted, the block cache keys need to be
repopulated with the file paths.

This change addresses the following:

  1. Always populate the block-cache key with path during its creation.
  2. Fetch the file paths corresponding to the file names of the block-cache key
    during restarts.
  3. Use the Data-Tiering-Manager APIs during cache-full scenario to evict the cold file blocks.

@wchevreuilwchevreuil left a comment

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.

You are passing @vinayakphegde 's commit together with yours in this PR, and this is causing conflicts with the target branch (the PR can't be merged). Please rebase your local branch first, resolve any conflicts locally and force push to your branch, making sure the PR is mergeable.

…ogic.
The time-based priority caching relies on the presence of file paths in the block-cache key.
However, in case of the persitent cache, the file paths are not persisted in the files.
Hence, when the region server is restarted, the block cache keys need to be
repopulated with the file paths.
This change addresses the following:
1. Always populate the block-cache key with path during its creation.
2. Fetch the file paths corresponding to the file names of the block-cache key
during restarts.
3. Use the Data-Tiering-Manager APIs during cache-full scenario to evict the cold file blocks.
Change-Id: Ice19bd41064c73538ee3d3755057813a531b9171
BlockCacheKey key = new BlockCacheKey(protoKey.getHfilename(), protoKey.getOffset(),
protoKey.getPrimaryReplicaBlock(), fromPb(protoKey.getBlockType()));

BlockCacheKey key;

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need handling with and without paths in the BlockCacheKey creation

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌docker1m 24sDocker failed to build yetus/hbase:8a715fadd5.
SubsystemReport/Notes
GITHUB PR#5826
JIRA IssueHBASE-28468
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@jhungund

Copy link
Copy Markdown
ContributorAuthor

You are passing @vinayakphegde 's commit together with yours in this PR, and this is causing conflicts with the target branch (the PR can't be merged). Please rebase your local branch first, resolve any conflicts locally and force push to your branch, making sure the PR is mergeable.

Ack!

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 49sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ HBASE-28463 Compile Tests _
+1 💚mvninstall3m 5sHBASE-28463 passed
+1 💚compile0m 51sHBASE-28463 passed
+1 💚shadedjars5m 17sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 27sHBASE-28463 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 49sthe patch passed
+1 💚compile0m 51sthe patch passed
+1 💚javac0m 51sthe patch passed
+1 💚shadedjars5m 13spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 26sthe patch passed
_ Other Tests _
-1 ❌unit243m 6shbase-server in the patch failed.
269m 17s
SubsystemReport/Notes
DockerClientAPI=1.45 ServerAPI=1.45 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5826
JIRA IssueHBASE-28468
Optional Testsjavac javadoc unit shadedjars compile
unameLinux ca34f533425f 5.4.0-172-generic #190-Ubuntu SMP Fri Feb 2 23:24:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionHBASE-28463 / b7bb8b9
Default JavaEclipse Adoptium-11.0.17+8
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/testReport/
Max. process+thread count5087 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 26sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ HBASE-28463 Compile Tests _
+1 💚mvninstall2m 47sHBASE-28463 passed
+1 💚compile0m 41sHBASE-28463 passed
+1 💚shadedjars5m 45sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 25sHBASE-28463 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 29sthe patch passed
+1 💚compile0m 41sthe patch passed
+1 💚javac0m 41sthe patch passed
+1 💚shadedjars5m 46spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 23sthe patch passed
_ Other Tests _
-1 ❌unit247m 40shbase-server in the patch failed.
271m 56s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5826
JIRA IssueHBASE-28468
Optional Testsjavac javadoc unit shadedjars compile
unameLinux f1920bd54ea5 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionHBASE-28463 / b7bb8b9
Default JavaTemurin-1.8.0_352-b08
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/testReport/
Max. process+thread count4768 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5826/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@wchevreuilwchevreuil left a comment

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.

Can we add a UT for the eviction logic? I can't see any test for that.

// update the offset and move on to the next block without actually going read all
// the way to the cache.
BlockCacheKey cacheKey = new BlockCacheKey(name, offset);
BlockCacheKey cacheKey = new BlockCacheKey(path, offset, true, BlockType.DATA);

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.

How do you know this is a Data block? At this point, I don't think this can be assumed.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The constructor used earlier(BlockCacheKey(name, offset);) sets these parameters internally. Hence, I used these parameters:

public BlockCacheKey(String hfileName, long offset) {
this(hfileName, offset, true, BlockType.DATA);
}

Comment on lines +146 to +148
// Data-Tiering manager has not been set up.
// Ignore the error and proceed with the normal flow.
LOG.error("Error while getting DataTieringManager instance: {}", e.getMessage());

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 this to be expected often? If so, let's lower the log level to DEBUG. If not, it seems we can still continue RS normal functioning, so it should rather be a WARNING than an ERROR.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

ack!

Comment on lines +939 to +948

// Check the list of files to determine the cold files which can be readily evicted.
Set<String> coldFiles =
DataTieringManager.getInstance().getColdDataFiles(backingMap.keySet());
if (coldFiles != null) {
for(String fileName : coldFiles) {
evictBlocksByHfileName(fileName);
}
}

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.

We can do like this here, but then can we think if we can modify DataTieringManager somehow to track when we have no CF with TIME_RANGE type? That way we could avoid this extra loops through the whole set of block keys unnecessarily.

Alternatively, we could follow the BucketEntryGroup logic starting from #987. We could define a COLD priority group and add that as the first group in the priority queue. That way we don't need this extra loop over the whole block sets to find out which blocks are cold. We would leverage the already existing loop from line #996 for that.

@wchevreuil

Copy link
Copy Markdown
Contributor

Can we close this PR and favour the #5829 as the solution for HBASE-28468?

@jhungund

Copy link
Copy Markdown
ContributorAuthor

Can we close this PR and favour the #5829 as the solution for HBASE-28468?

ack!

@jhungund

Copy link
Copy Markdown
ContributorAuthor

Closing this PR in favour of #5829 as the solution for HBASE-28468?

Sign up for freeto 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.

3 participants

@jhungund@Apache-HBase@wchevreuil