<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
Hmm.  I think because users can append to any file at any time, and also append to a file then write to it normally, we might override the users preferred layout for a file where appending is just a small part of the plan.  (And of course since we can’t control
 when users do append, it doesn’t let us handle the locking differently.)
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> lustre-discuss <lustre-discuss-bounces@lists.lustre.org> on behalf of Degremont, Aurelien <degremoa@amazon.com><br>
<b>Sent:</b> Friday, March 29, 2019 4:53:42 AM<br>
<b>To:</b> Andreas Dilger; LEIBOVICI Thomas<br>
<b>Cc:</b> lustre-discuss@lists.lustre.org<br>
<b>Subject:</b> Re: [lustre-discuss] EINVAL error when writing to a PFL file (lustre 2.12.0)</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
    <br>
    Another thought I just had while re-reading LU-9341 is whether it would be better to have the MDS always create files opened with O_APPEND with stripe_count=1?  There is no write parallelism for O_APPEND files, so having multiple stripes doesn't help the
 writer.  Because the writer also always locks the whole file [0,EOF] then there is no read-write parallelism either, so creating only a single file stripe simplifies things significantly with no real loss.<br>
    <br>
Having several stripes if still useful if you want to distribute space usage among several OSTs and also it could help if you have multiple readers later for this file.<br>
<br>
<br>
<br>
Aurélien<br>
<br>
<br>
    <br>
    Cheers, Andreas<br>
    <br>
    On Feb 22, 2019, at 10:09, LEIBOVICI Thomas <thomas.leibovici@cea.fr> wrote:<br>
    > <br>
    > Hello Patrick,<br>
    > <br>
    > Thank you for the quick reply.<br>
    > No, I have no particular use-case in mind, I'm just playing around with PFL.<br>
    > <br>
    > If this is currently not properly supported, a quick fix could be to prevent the user from creating such incomplete layouts?<br>
    > <br>
    > Regards,<br>
    > Thomas<br>
    > <br>
    > On 2/22/19 5:33 PM, Patrick Farrell wrote:<br>
    >> Thomas,<br>
    >> <br>
    >> This is expected, but it's also something we'd like to fix - See LU-9341.<br>
    >> <br>
    >> Basically, append tries to instantiate the layout from 0 to infinity, and it fails because your layout is incomplete (ie doesn't go to infinity).<br>
    >> <br>
    >> May I ask why you're creating a file with an incomplete layout?  Do you have a use case in mind?<br>
    >> <br>
    >> - Patrick<br>
    >> From: lustre-discuss <lustre-discuss-bounces@lists.lustre.org> on behalf of LEIBOVICI Thomas <thomas.leibovici@cea.fr><br>
    >> Sent: Friday, February 22, 2019 10:27:48 AM<br>
    >> To: lustre-discuss@lists.lustre.org<br>
    >> Subject: [lustre-discuss] EINVAL error when writing to a PFL file (lustre 2.12.0)<br>
    >>  <br>
    >> Hello,<br>
    >> <br>
    >> Is it expected to get an error when appending a PFL file made of 2 <br>
    >> regions [0 - 1M] and [1M to 6M]<br>
    >> even if writing in this range?<br>
    >> <br>
    >> I get an error when appending it, even when writting in the very first <br>
    >> bytes:<br>
    >> <br>
    >> [root@vm0]# lfs setstripe  -E 1M -c 1 -E 6M -c 2 /mnt/lustre/m_fou3<br>
    >> <br>
    >> [root@vm0]# lfs getstripe /mnt/lustre/m_fou3<br>
    >> /mnt/lustre/m_fou3<br>
    >>    lcm_layout_gen:    2<br>
    >>    lcm_mirror_count:  1<br>
    >>    lcm_entry_count:   2<br>
    >>      lcme_id:             1<br>
    >>      lcme_mirror_id:      0<br>
    >>      lcme_flags:          init<br>
    >>      lcme_extent.e_start: 0<br>
    >>      lcme_extent.e_end:   1048576<br>
    >>        lmm_stripe_count:  1<br>
    >>        lmm_stripe_size:   1048576<br>
    >>        lmm_pattern:       raid0<br>
    >>        lmm_layout_gen:    0<br>
    >>        lmm_stripe_offset: 3<br>
    >>        lmm_objects:<br>
    >>        - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x9cf:0x0] }<br>
    >> <br>
    >>      lcme_id:             2<br>
    >>      lcme_mirror_id:      0<br>
    >>      lcme_flags:          0<br>
    >>      lcme_extent.e_start: 1048576<br>
    >>      lcme_extent.e_end:   6291456<br>
    >>        lmm_stripe_count:  2<br>
    >>        lmm_stripe_size:   1048576<br>
    >>        lmm_pattern:       raid0<br>
    >>        lmm_layout_gen:    0<br>
    >>        lmm_stripe_offset: -1<br>
    >> <br>
    >> [root@vm0]# stat -c %s /mnt/lustre/m_fou3<br>
    >> 14<br>
    >> <br>
    >> * append fails:<br>
    >> <br>
    >> [root@vm0]# echo qsdkjqslkdjkj >> /mnt/lustre/m_fou3<br>
    >> bash: echo: write error: Invalid argument<br>
    >> <br>
    >> # strace indicates that write() gets the error:<br>
    >> <br>
    >> write(1, "qsdkjqslkdjkj\n", 14)         = -1 EINVAL (Invalid argument)<br>
    >> <br>
    >> * no error in case of an open/truncate:<br>
    >> <br>
    >> [root@vm0]# echo qsdkjqslkdjkj > /mnt/lustre/m_fou3<br>
    >> <br>
    >> OK<br>
    >> <br>
    >> Is it expected or should I open a ticket?<br>
    >> <br>
    >> Thomas<br>
    >> <br>
    >> _______________________________________________<br>
    >> lustre-discuss mailing list<br>
    >> lustre-discuss@lists.lustre.org<br>
    >> <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
    > <br>
    > _______________________________________________<br>
    > lustre-discuss mailing list<br>
    > lustre-discuss@lists.lustre.org<br>
    > <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
    <br>
    Cheers, Andreas<br>
    ---<br>
    Andreas Dilger<br>
    CTO Whamcloud<br>
    <br>
    <br>
    <br>
    <br>
    _______________________________________________<br>
    lustre-discuss mailing list<br>
    lustre-discuss@lists.lustre.org<br>
    <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
    <br>
<br>
_______________________________________________<br>
lustre-discuss mailing list<br>
lustre-discuss@lists.lustre.org<br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
</div>
</span></font></div>
</body>
</html>