You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "zhen.zhang (Code Review)" <ge...@cloudera.org> on 2017/12/21 12:14:22 UTC

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

zhen.zhang has uploaded this change for review. ( http://gerrit.cloudera.org:8080/8904


Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................

KUDU-2238. DMS not flush under memory pressure.

When we choose DMS to flush, now we always pick the DMS with
highest log retention. However, as KUDU-2238 shows, in some cases
DMS with highest log retention may only consume little memory, and
other DMSs may consume much more memory, but get no change to be
flushed, even under memory pressure.

This patch gives the ability to take memory consumption into
consideration when we choose DMS.

Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
---
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet.h
M src/kudu/tablet/tablet_replica_mm_ops.cc
3 files changed, 19 insertions(+), 8 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 1
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/1/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/1/src/kudu/tablet/tablet.cc@1897
PS1, Line 1897:   double mem_weight = FLAGS_mem_weight_when_choose_best_dms_to_flush;
instead of a new parameter maybe we should be basing this on whether the system is under memory pressure (eg using process_memory::UnderMemoryPressure)? ie if memory is tight we should prioritize on size, and if not, we should prioritize on retention? Then we wouldn't need the new tunable (which I'm not sure how to tune well)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 1
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Thu, 21 Dec 2017 17:59:26 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc@1909
PS2, Line 1909:         (size == retention_size && mem > mem_size)) {
> As both score and max_score are double, maybe it's not good to compare them
Good point.

In this case I think we should go with something like:

score > max_score - 1 && mem > mem_size

(we don't need to worry about std::abs since we already compared above the case where score > max_score). Since the units of score is bytes*100 here we expect large numbers and so I think "- 1" is pretty reasonable vs 0.0001 or something.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 2
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 17 Jan 2018 07:35:44 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/1/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/1/src/kudu/tablet/tablet.cc@1897
PS1, Line 1897: 
> instead of a new parameter maybe we should be basing this on whether the sy
I think that's a good idea, better than a static config, thanks Todd



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 2
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Fri, 22 Dec 2017 10:16:35 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 3:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc@1909
PS2, Line 1909:     double score = mem * mem_weight + size * (100 - mem_weight);
> should this tie-breaker line now say "score == max_score && mem > mem_size"
As both score and max_score are double, maybe it's not good to compare them, and "score==max_score" can represent the same logic, so I leave it here. BTW, I'm not sure how we do double comparison in kudu, is "std::abs(score-max_score) < 0.0001" good?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 3
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 17 Jan 2018 07:30:38 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

Posted by "zhen.zhang (Code Review)" <ge...@cloudera.org>.
Hello Mike Percy, Jean-Daniel Cryans, Kudu Jenkins, Todd Lipcon, 

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

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

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................

KUDU-2238. DMS not flush under memory pressure.

When we choose DMS to flush, now we always pick the DMS with
highest log retention. However, as KUDU-2238 shows, in some cases
DMS with highest log retention may only consume little memory, and
other DMSs may consume much more memory, but get no chance to be
flushed, even under memory pressure.

This patch gives the ability to take memory consumption into
consideration when we choose DMS.

Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
---
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet.h
M src/kudu/tablet/tablet_replica_mm_ops.cc
3 files changed, 18 insertions(+), 8 deletions(-)


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 2
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc@1909
PS2, Line 1909:         (size == retention_size && mem > mem_size)) {
should this tie-breaker line now say "score == max_score && mem > mem_size"?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 2
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 17 Jan 2018 06:12:12 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc
File src/kudu/tablet/tablet.cc:

http://gerrit.cloudera.org:8080/#/c/8904/2/src/kudu/tablet/tablet.cc@1909
PS2, Line 1909:         (score > max_score - 1 && mem > mem_size)) {
> Good point.
Good idea, thanks Todd. Already updated.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 4
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 17 Jan 2018 07:47:52 +0000
Gerrit-HasComments: Yes

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................


Patch Set 4: Code-Review+2

Looks good. Please report back if this helps with your workload


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 4
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>
Gerrit-Comment-Date: Wed, 17 Jan 2018 07:54:15 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

Posted by "zhen.zhang (Code Review)" <ge...@cloudera.org>.
Hello Mike Percy, Jean-Daniel Cryans, Kudu Jenkins, Todd Lipcon, 

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

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

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................

KUDU-2238. DMS not flush under memory pressure.

When we choose DMS to flush, now we always pick the DMS with
highest log retention. However, as KUDU-2238 shows, in some cases
DMS with highest log retention may only consume little memory, and
other DMSs may consume much more memory, but get no chance to be
flushed, even under memory pressure.

This patch gives the ability to take memory consumption into
consideration when we choose DMS.

Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
---
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet.h
M src/kudu/tablet/tablet_replica_mm_ops.cc
3 files changed, 18 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/04/8904/4
-- 
To view, visit http://gerrit.cloudera.org:8080/8904
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 4
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>

[kudu-CR] KUDU-2238. DMS not flush under memory pressure.

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

Change subject: KUDU-2238. DMS not flush under memory pressure.
......................................................................

KUDU-2238. DMS not flush under memory pressure.

When we choose DMS to flush, now we always pick the DMS with
highest log retention. However, as KUDU-2238 shows, in some cases
DMS with highest log retention may only consume little memory, and
other DMSs may consume much more memory, but get no chance to be
flushed, even under memory pressure.

This patch gives the ability to take memory consumption into
consideration when we choose DMS.

Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Reviewed-on: http://gerrit.cloudera.org:8080/8904
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
---
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet.h
M src/kudu/tablet/tablet_replica_mm_ops.cc
3 files changed, 18 insertions(+), 8 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Kudu Jenkins: Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0c04d76aa0e3888352dc56eeb493a5437ef47e42
Gerrit-Change-Number: 8904
Gerrit-PatchSet: 5
Gerrit-Owner: zhen.zhang <zh...@xiaomi.com>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: zhen.zhang <zh...@xiaomi.com>