asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luo Chen (Code Review)" <>
Subject Change in asterixdb[master]: Avoid always merging old components in prefix policy
Date Fri, 09 Jun 2017 21:15:56 GMT
Luo Chen has posted comments on this change.

Change subject: Avoid always merging old components in prefix policy

Patch Set 5:


 > some minor comments.
File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/

Line 49:      */
> maybe it's good to also put the source of this magic number?
Done, it's taken from HBase compaction policy

Line 143:         List<ILSMDiskComponent> immutableComponents = new ArrayList<>(index.getImmutableComponents());
> could you explain the reason of the reverse?
In the original list, the components are ordered from newest to oldest.
Reversing it makes the order from oldest to newest, and simplifies the logic of prefix policy.

Line 256:     }
> I think it's better to move this big chunk of comment before the function a

Line 266:      * ratio * total size of the younger components in the sequence, schedule a
merge of all sequences.
> just curious, to make sure the state check is consistent, is this function 
The merge policy is called by the exitComponent method of the LSMHarness (when a new disk
component is created because of flush/merge/load). The call of the merge policy is always
guarded by the synchronized block with opTracker.

Line 276:                 continue;
> if it's a suspicious state, it's better to add a warning log.
Hmm...I think some time this could happen (as a proper state).
1. When we call check isMergeLagging, we could see newer components are being merged;
2. totalSize is just an estimation of the size of the result component. It is possible that
the result size < maxMergeableSize (but totalSize > maxMergeableSize...)

Line 284:                         || immutableComponents.get(j).getState() != ComponentState.READABLE_UNWRITABLE)
> no need to use ternary?

Line 289:                 if (startComponentSize == 0) {
> it feels like we should treat two part of the && differently for the else c
It makes sense to separate these two conditions.
I also separated two canMerge conditions (>maxMergableSize or >maxToleranceCount) to
make the logic more complete.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I464da3fed38cded0aee7b319a35664eae069a2ba
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Luo Chen <>
Gerrit-Reviewer: Ian Maxon <>
Gerrit-Reviewer: Jenkins <>
Gerrit-Reviewer: Jianfeng Jia <>
Gerrit-Reviewer: Luo Chen <>
Gerrit-Reviewer: Yingyi Bu <>
Gerrit-Reviewer: abdullah alamoudi <>
Gerrit-HasComments: Yes

View raw message