<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
Hmm.&nbsp; 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.&nbsp; (And of course since we cant control
 when users do append, it doesnt 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 &lt;lustre-discuss-bounces@lists.lustre.org&gt; on behalf of Degremont, Aurelien &lt;degremoa@amazon.com&gt;<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>&nbsp;</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; 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?&nbsp; There is no write parallelism for O_APPEND files, so having multiple stripes doesn't help the
 writer.&nbsp; 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>
&nbsp;&nbsp;&nbsp; <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>
Aurlien<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; Cheers, Andreas<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; On Feb 22, 2019, at 10:09, LEIBOVICI Thomas &lt;thomas.leibovici@cea.fr&gt; wrote:<br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; Hello Patrick,<br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; Thank you for the quick reply.<br>
&nbsp;&nbsp;&nbsp; &gt; No, I have no particular use-case in mind, I'm just playing around with PFL.<br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; If this is currently not properly supported, a quick fix could be to prevent the user from creating such incomplete layouts?<br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; Regards,<br>
&nbsp;&nbsp;&nbsp; &gt; Thomas<br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; On 2/22/19 5:33 PM, Patrick Farrell wrote:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Thomas,<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; This is expected, but it's also something we'd like to fix - See LU-9341.<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; 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>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; May I ask why you're creating a file with an incomplete layout?&nbsp; Do you have a use case in mind?<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; - Patrick<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; From: lustre-discuss &lt;lustre-discuss-bounces@lists.lustre.org&gt; on behalf of LEIBOVICI Thomas &lt;thomas.leibovici@cea.fr&gt;<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Sent: Friday, February 22, 2019 10:27:48 AM<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; To: lustre-discuss@lists.lustre.org<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Subject: [lustre-discuss] EINVAL error when writing to a PFL file (lustre 2.12.0)<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Hello,<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Is it expected to get an error when appending a PFL file made of 2 <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; regions [0 - 1M] and [1M to 6M]<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; even if writing in this range?<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; I get an error when appending it, even when writting in the very first <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; bytes:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; [root@vm0]# lfs setstripe&nbsp; -E 1M -c 1 -E 6M -c 2 /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; [root@vm0]# lfs getstripe /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp; lcm_layout_gen:&nbsp;&nbsp;&nbsp; 2<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp; lcm_mirror_count:&nbsp; 1<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp; lcm_entry_count:&nbsp;&nbsp; 2<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcme_id:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcme_mirror_id:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcme_flags:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; init<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcme_extent.e_start: 0<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lcme_extent.e_end:&nbsp;&nbsp; 1048576<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_stripe_count:&nbsp; 1<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_stripe_size:&nbsp;&nbsp; 1048576<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_pattern:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raid0<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_layout_gen:&nbsp;&nbsp;&nbsp; 0<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_stripe_offset: 3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lmm_objects:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x9cf:0x0] }<br>
&nb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;&nbsp; lmm_stripe_offset: -1<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; [root@vm0]# stat -c %s /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; 14<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; * append fails:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; [root@vm0]# echo qsdkjqslkdjkj &gt;&gt; /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; bash: echo: write error: Invalid argument<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; # strace indicates that write() gets the error:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; write(1, &quot;qsdkjqslkdjkj\n&quot;, 14)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1 EINVAL (Invalid argument)<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; * no error in case of an open/truncate:<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; [root@vm0]# echo qsdkjqslkdjkj &gt; /mnt/lustre/m_fou3<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; OK<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Is it expected or should I open a ticket?<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; Thomas<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <br>
&nbsp;&nbsp;&nbsp; &gt;&gt; _______________________________________________<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; lustre-discuss mailing list<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; lustre-discuss@lists.lustre.org<br>
&nbsp;&nbsp;&nbsp; &gt;&gt; <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
&nbsp;&nbsp;&nbsp; &gt; <br>
&nbsp;&nbsp;&nbsp; &gt; _______________________________________________<br>
&nbsp;&nbsp;&nbsp; &gt; lustre-discuss mailing list<br>
&nbsp;&nbsp;&nbsp; &gt; lustre-discuss@lists.lustre.org<br>
&nbsp;&nbsp;&nbsp; &gt; <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; Cheers, Andreas<br>
&nbsp;&nbsp;&nbsp; ---<br>
&nbsp;&nbsp;&nbsp; Andreas Dilger<br>
&nbsp;&nbsp;&nbsp; CTO Whamcloud<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; _______________________________________________<br>
&nbsp;&nbsp;&nbsp; lustre-discuss mailing list<br>
&nbsp;&nbsp;&nbsp; lustre-discuss@lists.lustre.org<br>
&nbsp;&nbsp;&nbsp; <a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
&nbsp;&nbsp;&nbsp; <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>