[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openais
Subject:    [Openais] Re: Multiple iterations over a checkpoint fails? (v.
From:       Steven Dake <sdake () mvista ! com>
Date:       2006-02-23 22:03:10
Message-ID: 1140732190.24709.42.camel () unnamed ! az ! mvista ! com
[Download RAW message or body]

Even with this patch the checkpoint iteration code is not compliant with
the specifications.  The current limitation is there may only be one
iterator per checkpoint handle.  This shouldn't be much of a problem in
simple apps.

Unfortunately the only way to make it compliant is to break backwards
compatibility or maybe it can be done without breaking compatability in
a painful way.  Rather then do that, I'll integrate this patch into
picacho and we will fix the problem so multiple instances of iterators
can exist on the same checkpoint as intended by the specification for
the trunk version.

Regards
-steve

On Wed, 2006-02-22 at 16:29 -0700, Steven Dake wrote:
> Find attached a patch for the problem you reported.  Thanks for the bug report.
> 
> the iterator position for the checkpoint connection wasn't reset.
> 
> On 2/22/06, Steven Dake <sdake@mvista.com> wrote:
> > Bjorn,
> > This code should work.  I'll find a solution for you tonight on the
> > plane ride home.
> >
> > thanks
> > -steve
> > On Wed, 2006-02-22 at 20:39 +0200, Bjorn Andersson wrote:
> > > The following example code does not work as I would expect. I have a
> > > checkpoint with sections. Reading the sections work the first time.
> > > But when the while(1) loop is run the second time I get no sections.
> > > Initialize does not return an error, IterationNext returns
> > > SA_AIS_ERR_NO_SECTIONS on the first call. Restarting the app returns
> > > the sections again (during the first while(1) loop). Is there some
> > > state that is incorrectly maintained in the section iteration
> > > functions?
> > >
> > >
> > >
> > > 	saError = saCkptCheckpointOpen(ckptHandle, &ckptName,
> > > 				       NULL,
> > > 				       SA_CKPT_CHECKPOINT_READ,
> > > 				       SA_TIME_END,
> > > 				       &ckptCheckpointHandle);
> > > 	if (saError != SA_AIS_OK) {
> > > 		fprintf(stderr, "Open failed: %d\n", saError);
> > > 		exit(1);
> > > 	}
> > >
> > > 	while (1) {
> > > 		saError = saCkptSectionIterationInitialize(ckptCheckpointHandle,
> > > 							   SA_CKPT_SECTIONS_ANY,
> > > 							   SA_TIME_END,
> > > 							   &sectionIterator);
> > > 		while (saError == SA_AIS_OK) {
> > > 			saError = saCkptSectionIterationNext(sectionIterator,
> > &sectionDescriptor);
> > > 			if (saError == SA_AIS_OK) {
> > > 				dump_section(&sectionDescriptor);
> > > 			}
> > > 			
> > > 		}
> > > 		
> > > 		saError = saCkptSectionIterationFinalize(sectionIterator);
> > > 		sleep(5);
> > > 	}
> > >
> > > _______________________________________________
> > > Openais mailing list
> > > Openais@lists.osdl.org
> > > https://lists.osdl.org/mailman/listinfo/openais
> >
> >
> >



_______________________________________________
Openais mailing list
Openais@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/openais


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic