horizonzy commented on code in PR #3833:
URL: https://github.com/apache/bookkeeper/pull/3833#discussion_r1184648942
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerFragment.java:
##########
@@ -229,15 +229,16 @@ public void setReplicateType(ReplicateType replicateType)
{
@Override
public String toString() {
return String.format("Fragment(LedgerID: %d, FirstEntryID: %d[%d], "
- + "LastKnownEntryID: %d[%d], Host: %s, Closed: %s)", ledgerId,
firstEntryId,
+ + "LastKnownEntryID: %d[%d], Host: %s, Closed: %s, Type: %s)",
ledgerId, firstEntryId,
getFirstStoredEntryId(), lastKnownEntryId,
getLastStoredEntryId(),
- getAddresses(), isLedgerClosed);
+ getAddresses(), isLedgerClosed, replicateType);
}
/**
* ReplicateType.
*/
public enum ReplicateType {
+ NULL,
Review Comment:
In my opinion, the replicateType doesn't represent the state; it only
records the use of the LedgerFragment.
The default value is data_loss, because the data_loss priority is the
highest. The ledger may be data_loss and not adhere to the placement policy at
the same time, we fix the data_loss case firstly, it may cover the not adhere
to the placement policy case.
> AuditorCheckAllLedgersTask and ReplicationWorker use LedgerChecker
checkLedger. By default, it will check the first and last Entry of each
LedgerFragment of the ledger before the check is completed.
In this case, it only checks if the ledger data is loss or not, the
replicationType should be DATA_LOSS.
In AuditorPlacementPolicyCheckTask, it will check if the ledger ensemble
adheres to the placement policy or not. If so, mark the ledger unreplicated. It
didn't use LedgerChecker.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]