BOOKKEEPER-950: Ledger placement policy to accomodate different storage capacity of bookies#93
Conversation
|
@rithin-shetty sorry for late response. I will try to get to this one this week. btw this pull request has conflicts on bookkeeper-server/pom.xml. do you mind rebasing it? |
e78b11d to
745f3db
Compare
|
@sijie thanks for pointing that out. I have now rebased and updated the branch. The merge conflict should be gone.... |
745f3db to
5744d53
Compare
eolivelli
left a comment
There was a problem hiding this comment.
Sorry my review has been pending for days
| * A map that has the bookie to BookieInfo | ||
| */ | ||
| public void updateBookieInfo(Map<BookieSocketAddress, BookieInfo> bookieInfoMap); | ||
| } |
There was a problem hiding this comment.
Can you add a default noop implementation?
There was a problem hiding this comment.
Sure, I'll add a default implementation.
| protected final static String BOOKIE_QUARANTINE_TIME_SECONDS = "bookieQuarantineTimeSeconds"; | ||
|
|
||
| // Bookie info poll interval | ||
| protected final static String DISK_WEIGHT_BASED_PLACEMENT_ENABLED = "diskWeightBasedPlacementEnabled"; |
There was a problem hiding this comment.
Maybe it would be better to distinguish the polling of bookieinfo from the activation of the new behaviour ?
This way from BookKeeper client I will be able to ask the global status of the system without using the new policy
There was a problem hiding this comment.
What is your use case ? Do you want to retrieve the status from all the bookies just once or on a periodic basis ? I'd suggest when you extend the usage of this feature, make the necessary adjustments. You'll have a clearer idea of what the requirements are.
There was a problem hiding this comment.
You are right, when we will need to have this info for other purposes we will introduce new flags.
My idea was just to be able to ask for bookie status without altering how the placement policy works, but actually I have to valid use case.
5744d53 to
46a0a0f
Compare
46a0a0f to
0c1b185
Compare
sijie
left a comment
There was a problem hiding this comment.
overall looks good to me.
some minor comments and the pr needs to rebase on latest master.
after that, it is ready for merging.
| private final AtomicBoolean refreshBookieList = new AtomicBoolean(); | ||
|
|
||
| public static class BookieInfo implements WeightedObject { | ||
| private long freeDiskSpace; |
There was a problem hiding this comment.
ok. modified...
|
|
||
| public static class BookieInfo implements WeightedObject { | ||
| private long freeDiskSpace; | ||
| private long totalDiskSpace; |
There was a problem hiding this comment.
ok. made final...
0c1b185 to
8c2d5a9
Compare
|
@sijie I've addressed your comments. I've uploaded the merged changes. But the Jenkins build has been failing with the following error for some time now. Do you know how to fix this ? It's very annoying and should be fixed. [ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.7:check (default-cli) on project bookkeeper-server: Too many unapproved licenses: 2 -> [Help 1] |
|
@rithin-shetty I am fixing that by #103 |
|
LGTM. +1 @eolivelli since you were also reviewing this change, can you take a look at the updated pull request? |
eolivelli
left a comment
There was a problem hiding this comment.
One minor comment (see inline comments).
@rithin-shetty @sijie
I think it would be better to add a test case on the timeout on GetBookieInfo, something like testReadTimeout
| return lOpts; | ||
| } | ||
|
|
||
| String getReadable(long val) { |
There was a problem hiding this comment.
maybe this could be 'static' ?
There was a problem hiding this comment.
since this is a nested class, I can't make it static.
| @@ -0,0 +1,71 @@ | |||
| package org.apache.bookkeeper.proto; | |||
8c2d5a9 to
3892c2e
Compare
|
@eolivelli I have added a new test case for testing the timeout of GET_BOOKIE_INFO op. See TestGetBookieInfoTimeout.java |
| try { | ||
| allBookies = new ArrayList<BookieSocketAddress>(knownBookies); | ||
| } finally { | ||
| rwLock.readLock().unlock(); |
There was a problem hiding this comment.
Do we need to consider the race that 'knownBookies' is changed between this line and line 79?
There was a problem hiding this comment.
Thats should be ok because if we end up choosing a bookie that just went down, the write will fail and we'll come back and change the ensemble. BTW, this could happen even without my change. So I'm not changing the situation any way.
3892c2e to
675007a
Compare
|
For me is ok |
675007a to
9a61541
Compare
9a61541 to
d390900
Compare
sijie
left a comment
There was a problem hiding this comment.
LGTM +1. @rithin-shetty Do you mind helping me rebase the pull request? so I can merge it.
…ge capacity of bookies This change introduces Disk weight based ledger placement. Currently free disk space is the only supported weight for a bookie. This change also introduces a new protocol message between bk client and server called GET_BOOKIE_INFO. This message is used by the client to retrieve the free disk space info from all the bookies. The existing placement policies: DefaultPlacementPolicy and RackAwarePlacementPolicy have been enhanced to make use of the weight while selecting bookies. New test cases have been added to test RackawarePlacement with weights. A new test class has been added to test the weight based selection algorithm in a stand alone fashion.
d390900 to
b411161
Compare
|
@sijie, I have merged and uploaded the latest diffs. |
… non-writable channel (apache#93) - Logging is more detailed now. - Ones PCBC fail request because of non-writable channel it will fast fail other requests until channel becomes writable. - addressed cases when checks for channel nullability allowed null channel later if updated concurrently (@Rev vjujjuri@)
…ge capacity of bookies
This change introduces Disk weight based ledger placement. Currently free disk space is the only supported
weight for a bookie. This change also introduces a new protocol message between bk client and server
called GET_BOOKIE_INFO. This message is used by the client to retrieve the free disk space info from
all the bookies. The existing placement policies: DefaultPlacementPolicy and RackAwarePlacementPolicy
have been enhanced to make use of the weight while selecting bookies. New test cases have been added to
test RackawarePlacement with weights. A new test class has been added to test the weight based selection
algorithm in a stand alone fashion.