[Openais] more about readSize in saCkptCheckpointRead()

Steven Dake sdake at mvista.com
Fri Jul 29 13:07:30 PDT 2005


Maxi
After trying to duplicate your issue, I found an interesting issue which
is that the default section id was initialized to some data and had a
data size of 23.

I did not find your exact problem of the read returning 278.

There are three possibilities
your libs and binaries are out of phase.  Try make clean on the whole
thing and start over

you are writing the checkpoint section in another
process/thread/whatever of size 278.  It may have been written a long
time ago.  The default section is retained for the life of the cluster
for a checkpoint.

In your environment some bug demonstrates itself that I am unable to
duplicate.

Are you having configuration changes (changes in membership) between the
write and read operation?  There could be some sort of bug there.

I used your pseudocode to create a program in the attached patch called
testrs.c  If you can make this testrs.c code demonstrate the issue by a
few changes, I'd be happy to take a look.

Thanks for the report

regards
-steve


On Fri, 2005-07-29 at 14:42 -0300, Maxi Combina wrote:
> Hi again :)
> I have been testing the openais service after applying the
> defect-784.patch posted in this list.
> In first place, I have posted a mail saying that it worked, but
> further tests show that, in fact, there is still something wrong...
> 
> I put a pseudo code here of the test I ran:
> -----------------------------> cut here <----------------------------------
> #define STRING "1234567890"
> #define BUFFSIZE 400
> 
>   SaCkptIOVectorElementT e;
>   char c[] = STRING;
>   char d[BUFFSIZE];
>   memset(d, '\0', BUFFSIZE);
>      
>     saCkptInitialize();
> 
>     saCkptCheckpointOpen();
> 
>     printf("strlen(STRING) = %d\n", strlen(STRING));
>   
>     e.sectionId = (SaCkptSectionIdT) SA_CKPT_DEFAULT_SECTION_ID;
>     e.dataBuffer = c;
>     e.dataSize = strlen(STRING);
>     e.dataOffset = 0;
>     e.readSize = 0;
>       
>     saCkptCheckpointWrite(handle previously obtained, &e, 1, NULL);
>       
>     e.sectionId = (SaCkptSectionIdT) SA_CKPT_DEFAULT_SECTION_ID;
>     e.dataBuffer = d;
>     e.dataSize = BUFFSIZE;
>     e.dataOffset = 0;
>     e.readSize = 0;
> 
>     saCkptCheckpointRead(handle previously obtained, &e, 1, NULL);
>     printf("read bytes from ckpt = %llu\n", e.readSize);
> -----------------------------> cut here <----------------------------------
> 
> 
> and the output is:
> -----------------------------> cut here <----------------------------------
> strlen(STRING) = 10
> read bytes from ckpt = 278
> -----------------------------> cut here <----------------------------------
> 
> Wow!! I wrote 10 bytes, and then asked the service to read 400 bytes.
> According to the discussion in other thread of the list, ckpt service
> should have put 10 in e.readSize after the invocation of
> saCkptCheckpointRead(), but it says 278 !!
> 
> Regards,
> Maxi
> --
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/openais
-------------- next part --------------
A non-text attachment was scrubbed...
Name: defect-784-2.patch
Type: text/x-patch
Size: 8685 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20050729/ea04095f/defect-784-2-0001.bin


More information about the Openais mailing list