You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Mahesh Reddy (Code Review)" <ge...@cloudera.org> on 2025/02/12 06:37:57 UTC

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Mahesh Reddy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/22478


Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................

KUDU-613: Fix BlockCache Constructor

There's currently an error when creating a
block cache with the slru eviction policy.
The capacity constraints are not calculated
properly, this patch fixes the error.

Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
---
M src/kudu/cfile/block_cache.cc
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/78/22478/1
-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 1
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 3: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/1073/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2025 08:20:21 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 2: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/1069/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 21:05:41 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 3:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/1073/


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2025 07:29:33 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................

KUDU-613: Fix BlockCache Constructor

The capacity constraints are not calculated properly
when creating a block cache with the slru eviction
policy. This patch fixes this miscalculation.

Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Reviewed-on: http://gerrit.cloudera.org:8080/22478
Reviewed-by: Alexey Serbin <al...@apache.org>
Tested-by: Alexey Serbin <al...@apache.org>
---
M src/kudu/cfile/block_cache.cc
1 file changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved; Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 4
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 1:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/1065/


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 1
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 12 Feb 2025 06:38:04 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 2:

> Patch Set 2: Verified-1
> 
> Build Failed 
> 
> http://jenkins.kudu.apache.org/job/pre_commit/1069/ : FAILURE

Unrelated Java test failures in TSAN


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 21:08:11 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/22478

to look at the new patch set (#2).

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................

KUDU-613: Fix BlockCache Constructor

The capacity constraints are not calculated properly
when creating a block cache with the slru eviction
policy. This patch fixes this miscalculation.

Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
---
M src/kudu/cfile/block_cache.cc
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/78/22478/2
-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 1: Verified+1

Build Successful 

http://jenkins.kudu.apache.org/job/pre_commit/1065/ : SUCCESS


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 1
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 07:18:05 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG@11
PS1, Line 11: The capacity constraints are not calculated
            : properly, this patch fixes the error.
Is there a chance to have basic/smoke test scenario to protect against an issue like this if thinking about possible future regressions?



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 1
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 07:50:44 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG@11
PS1, Line 11: policy. This patch fixes this miscalculation.
            : 
> I was thinking about adding an ASSERT statement after calculating the capac
Could you add a trivial check for the expected sizes of each of the SLRU cache shards based on 'ideal' values for FLAGS_block_cache_protected_segment_percentage
and FLAGS_block_cache_capacity_mb where no rounding errors are present?  Such a test should have caught the bug if it was present.

It shouldn't a big deal given we already have some scaffolding in block_cache-test.cc and you have spent months observing strange results while evaluating the performance of the SLRU cache, should it?


http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc@253
PS1, Line 253: static_cast<int6
> Good point, casted it to a int64. As for the loss of precision for large do
I don't think precision loss is something we should be concerned about: FLAGS_block_cache_capacity_mb's default is 512 and in real world cluster it's usually set to a few GiBytes at least.  If you think that's a problem, I can suggest the following alternatives:
  * compute the size of the protected segment based numbers rounding of block_cache_protected_segment_percentage multiplication, but compute the size of the probation segment by subtracting the former integer number from FLAGS_block_cache_capacity_mb * 1024 * 1024
  * consider changing block_cache_protected_segment_percentage to an integer flag, and adopt semantics that's similar to memory_pressure_percentage and other existing flags like that

My comment on the float-to-integer conversions was to warn on corner cases where values might be close to INT64_MAX, but that's not applicable in this particular case since we are working with realistic amount of available memory on a machine.


http://gerrit.cloudera.org:8080/#/c/22478/2/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/2/src/kudu/cfile/block_cache.cc@248
PS2, Line 248: FLAGS_block_cache_capacity_mb * 1024 * 1024
style nit: does it make sense to introduce a named constant for this and reuse it in this constructor here and below?



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 21:09:22 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG@11
PS1, Line 11: policy. This patch fixes this miscalculation.
            : 
> Is there a chance to have basic/smoke test scenario to protect against an i
I was thinking about adding an ASSERT statement after calculating the capacities for them both adding up to block_cache_capacity. The issue is for larger values, it would fail due to precision loss. I'm not sure how to add one that accounts for the regular expected case and one would that accounts for cases with larger values since the precision loss would be different depending on how large the value is.


http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc@253
PS1, Line 253: static_cast<int6
> What if the result number before this cast here and below is greater than 2
Good point, casted it to a int64. As for the loss of precision for large double values, I'm not too sure what else can be done there. If we could somehow avoid it being a large double value, that could help avoid precision loss. One way around this would be omitting the protected_segment_percentage parameter and having the user input the capacities for both segments. Any ideas are welcome, thanks for bringing this up.



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 19:33:50 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 3: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG@11
PS1, Line 11: policy. This patch fixes this miscalculation.
            : 
> I added a DCHECK_EQ statement for now. I had some trouble accessing the pri
Yes, I think it's good enough now: by my understanding, with having DCHECK_EQ() as of PS3, we should have been able to caught a bug like this.

Thank you for adding that!



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2025 19:31:06 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/22478

to look at the new patch set (#3).

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................

KUDU-613: Fix BlockCache Constructor

The capacity constraints are not calculated properly
when creating a block cache with the slru eviction
policy. This patch fixes this miscalculation.

Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
---
M src/kudu/cfile/block_cache.cc
1 file changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/78/22478/3
-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 3: Verified+1

unrelated test failures:
  * RELEASE: KUDU-3641
  * ASAN: org.apache.kudu.spark.kudu.DefaultSourceTest (seems to be KUDU-3194)


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2025 19:40:36 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 2:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/1069/


-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 2
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 19:33:41 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22478/1//COMMIT_MSG@11
PS1, Line 11: policy. This patch fixes this miscalculation.
            : 
> Could you add a trivial check for the expected sizes of each of the SLRU ca
I added a DCHECK_EQ statement for now. I had some trouble accessing the private members of the slru cache within the block_cache-test even after declaring it a friend test in the slru cache. Needed to be able to access the private member shards_ to know how many shards there are. Let me know if the DCHECK isn't sufficient.


http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc@253
PS1, Line 253: 4_t probationary
> I don't think precision loss is something we should be concerned about: FLA
Ack


http://gerrit.cloudera.org:8080/#/c/22478/2/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/2/src/kudu/cfile/block_cache.cc@248
PS2, Line 248: cy::LRU) {
> style nit: does it make sense to introduce a named constant for this and re
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 3
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 13 Feb 2025 07:29:56 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-613: Fix BlockCache Constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22478 )

Change subject: KUDU-613: Fix BlockCache Constructor
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc
File src/kudu/cfile/block_cache.cc:

http://gerrit.cloudera.org:8080/#/c/22478/1/src/kudu/cfile/block_cache.cc@253
PS1, Line 253: static_cast<int>
What if the result number before this cast here and below is greater than 2^31 (e.g. 2GiB)?  Isn't this just another bug?

BTW, casting a double/float to an integer doesn't always provide the desired result for huge values, but it seems this isn't a problem in this particular case.  But it should provide some extra context if you are about to address the issue pointed above.



-- 
To view, visit http://gerrit.cloudera.org:8080/22478
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfde56fd766ba7160052e88ca09a63845f3297c6
Gerrit-Change-Number: 22478
Gerrit-PatchSet: 1
Gerrit-Owner: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2025 07:45:28 +0000
Gerrit-HasComments: Yes