Xushaohong commented on PR #643: URL: https://github.com/apache/ratis/pull/643#issuecomment-1122035694
> Thanks @Xushaohong for taking a look. > > > The leader is newly started and has not truncated the raft log yet. The firstAvailable will be 0 here. > > Should it wait until truncation before sending the notifyInstallSnapshot message? I think it no necessary. The original purpose of https://issues.apache.org/jira/browse/RATIS-1390 seems to trigger an immediate snapshot install for a bootstrapped peer. The written prerequisite is ```The leader sends the snapshot only when some or all of the ratis logs have been purged.``` The truth is currently it will trigger a snapshot no matter whether the ratis log has been purged. In my understanding, it's not bad and also makes sense since such a case only happens at the init stage of the cluster. > > installing a snapshot to 0 is strange > Does the snapshot with index 0 contain any information? What about later terms (e.g. `t:5, i:0`)? > If it's an empty snapshot, should we short-circuit such snapshot by returning e.g. `ALREADY_INSTALLED`? Nope. The first available index received from the ratis side for OM/SCM/Container is not used, only shown in logs as for information and we obtain the DB checkpoint from the leader for the latest one, whose index could be already updated. For the ozone side, there won't be any empty snapshots. Even before any data is written in the cluster, a snapshot/checkpoint of RDB is non-empty. -- 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]
