Yikes! you're right. We should be saving the rc here, triggering the
latch and then throwing an exception in flushAndSync(). This is a
bug. I've created a JIRA,
https://issues.apache.org/jira/browse/HDFS-2717 to fix this.
-Ivan
On Thu, Dec 22, 2011 at 05:39:55PM +0800, Dongdong Guo wrote:
> I saw the source code, but i can not find the place where throw an exception
>
> @Override
> public void addComplete(int rc, LedgerHandle handle,
> long entryId, Object ctx) {
> synchronized(this) {
> outstandingRequests.decrementAndGet();
> CountDownLatch l = syncLatch;
> if (l != null) {
> l.countDown();
> }
> }
> }
>
> "rc" is not used
> and i have another questions that If adding the Entry failed and I stop the
> "LedgerHandle", does it mean the subsequence data is not added
>
> ----- 原始邮件 -----
> 发件人: "Ivan Kelly" <[email protected]>
> 收件人: [email protected]
> 发送时间: 星期四, 2011年 12 月 22日 下午 5:19:46
> 主题: Re: Question about "asyncAddEntry"
>
> We recently submitted a bookkeeper namenode journal implementation to
> HDFS. It's a contrib module of hadoop-hdfs-project/hadoop-hdfs.
>
> See
> https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/
>
> To answer your question, if the add fails, then the log operation
> should throw an exception, and the bookkeeper journal manager should
> be moved out of rotation. If it is the only active journal manager,
> this will lead to the namenode crashing. This is because it's better
> to impede progress, than to allow progress which would be lost in a
> crash.
>
> -Ivan
>
> On Thu, Dec 22, 2011 at 04:44:48PM +0800, Dongdong Guo wrote:
> > I use the bookkeeper to store the namenode transcation log, when i add the
> > entry to "LedgerHandle", the callback function "AddCallback", if the "rc"
> > is not "ok", how do i deal with it,