<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:57:45 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-13030] pcc: auto_attach doesn&apos;t work after client cache cleared</title>
                <link>https://jira.whamcloud.com/browse/LU-13030</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;PCC auto_attach feature doesn&apos;t work and no re-attach after clear caches on client.&lt;br/&gt;
 Here is a reproducer.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;PCC auto_attach feature doesn&apos;t work and no re-attach after clear caches on client.

Enable HSM
[root@c01 ~]# clush -w mds[01-02] lctl set_param mdt.*.hsm_control=enabled
mds01: mdt.ai400-MDT0000.hsm_control=enabled
mds02: mdt.ai400-MDT0001.hsm_control=enabled

Create PCC cache space
[root@c01 ~]# mkfs.ext4 /dev/sdb 
[root@c01 ~]# mount /dev/sdb /pcc 

Start HSM copytool
[root@c01 ~]# lhsmtool_posix --daemon --hsm-root /pcc --archive=1 /ai400
[root@c01 ~]# ps -ef | grep hsm
root      2872     1  0 15:09 ?        00:00:00 lhsmtool_posix --daemon --hsm-root /pcc --archive=1 /ai400
root      2874  2340  0 15:09 pts/0    00:00:00 grep --color=auto hsm

Enable PCC with projid=100
[root@c01 ~]# lctl pcc add /ai400 /pcc -p &quot;projid={100} auto_attach=1 rwid=1&quot;
[root@c01 ~]# lctl pcc list /ai400
/pcc:
  rwid: 1
  flags: 1f
  autocache: projid={100}

Reproducer
[root@c01 ~]# mkdir /ai400/lpcc
[root@c01 ~]# lfs project -sp 100 /ai400/lpcc/
[root@c01 ~]# echo &quot;QQQ&quot; &amp;gt; /ai400/lpcc/test
[root@c01 ~]# lfs pcc state /ai400/lpcc/test
file: /ai400/lpcc/test, type: readwrite, PCC file: /0082/0000/0403/0000/0002/0000/0x200000403:0x82:0x0, user number: 0, flags: 1c
[root@c01 ~]# echo 3 &amp;gt; /proc/sys/vm/drop_caches

[root@c01 ~]# lfs pcc state /ai400/lpcc/test
file: /ai400/lpcc/test, type: none
[root@c01 ~]# lfs pcc state /ai400/lpcc/test
file: /ai400/lpcc/test, type: none
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After drop cache on client, &apos;lfs pcc state&apos; should trigger auto_attach, but it doesn&apos;t.&lt;/p&gt;</description>
                <environment>pcc</environment>
        <key id="57499">LU-13030</key>
            <summary>pcc: auto_attach doesn&apos;t work after client cache cleared</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="qian_wc">Qian Yingjin</assignee>
                                    <reporter username="sihara">Shuichi Ihara</reporter>
                        <labels>
                            <label>PCC</label>
                    </labels>
                <created>Thu, 28 Nov 2019 09:17:19 +0000</created>
                <updated>Thu, 5 Dec 2019 13:13:56 +0000</updated>
                            <resolved>Thu, 5 Dec 2019 13:13:56 +0000</resolved>
                                    <version>Lustre 2.13.0</version>
                                    <fixVersion>Lustre 2.13.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="258959" author="gerrit" created="Thu, 28 Nov 2019 14:52:13 +0000"  >&lt;p&gt;Yingjin Qian (qian@ddn.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36892&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36892&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13030&quot; title=&quot;pcc: auto_attach doesn&amp;#39;t work after client cache cleared&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13030&quot;&gt;&lt;del&gt;LU-13030&lt;/del&gt;&lt;/a&gt; pcc: auto attach not work after chient cache clear&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 248b0baf1b9c87e97350884e8a8e7944c4fc65d0&lt;/p&gt;</comment>
                            <comment id="259097" author="gerrit" created="Tue, 3 Dec 2019 18:59:36 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36892/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36892/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13030&quot; title=&quot;pcc: auto_attach doesn&amp;#39;t work after client cache cleared&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13030&quot;&gt;&lt;del&gt;LU-13030&lt;/del&gt;&lt;/a&gt; pcc: auto attach not work after client cache clear&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: a5ef2d6e068eae5a055746b0f79ce6749f4c9a6d&lt;/p&gt;</comment>
                            <comment id="259101" author="pjones" created="Tue, 3 Dec 2019 19:19:01 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="259152" author="sihara" created="Wed, 4 Dec 2019 13:42:50 +0000"  >&lt;p&gt;It seems patch is not enough? and still strange behaviors when if it triggers multiple &quot;drop caches&quot; on client. Here is case.&lt;br/&gt;
 cerate 8 x 100M file with fio.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# /work/tools/bin/fio -name=randread -ioengine=sync -rw=randread -blocksize=4k -iodepth=1 -direct=1 -size=100m -runtime=10 -numjobs=8 -group_reporting -directory=/ai400/proj100 -create_serialize=0 -filename_format=&apos;f.$jobnum.$filenum&apos;

[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: readwrite, PCC file: /0008/0000/0401/0000/0002/0000/0x200000401:0x8:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.1.0, type: readwrite, PCC file: /0006/0000/0401/0000/0002/0000/0x200000401:0x6:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.2.0, type: readwrite, PCC file: /0003/0000/0401/0000/0002/0000/0x200000401:0x3:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.3.0, type: readwrite, PCC file: /0005/0000/0401/0000/0002/0000/0x200000401:0x5:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.4.0, type: readwrite, PCC file: /0004/0000/0401/0000/0002/0000/0x200000401:0x4:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.5.0, type: readwrite, PCC file: /0007/0000/0401/0000/0002/0000/0x200000401:0x7:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.6.0, type: readwrite, PCC file: /0009/0000/0401/0000/0002/0000/0x200000401:0x9:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.7.0, type: readwrite, PCC file: /000a/0000/0401/0000/0002/0000/0x200000401:0xa:0x0, user number: 0, flags: 0

state is fine here.

[root@c01 ~]# echo 3 &amp;gt; /proc/sys/vm/drop_caches 
[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: readwrite, PCC file: /0008/0000/0401/0000/0002/0000/0x200000401:0x8:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.1.0, type: readwrite, PCC file: /0006/0000/0401/0000/0002/0000/0x200000401:0x6:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.2.0, type: readwrite, PCC file: /0003/0000/0401/0000/0002/0000/0x200000401:0x3:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.3.0, type: readwrite, PCC file: /0005/0000/0401/0000/0002/0000/0x200000401:0x5:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.4.0, type: readwrite, PCC file: /0004/0000/0401/0000/0002/0000/0x200000401:0x4:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.5.0, type: readwrite, PCC file: /0007/0000/0401/0000/0002/0000/0x200000401:0x7:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.6.0, type: readwrite, PCC file: /0009/0000/0401/0000/0002/0000/0x200000401:0x9:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.7.0, type: readwrite, PCC file: /000a/0000/0401/0000/0002/0000/0x200000401:0xa:0x0, user number: 0, flags: 0

state is fine even after drop cache.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;However, if drop cache on client again, all state are none and doesn&apos;t re-attach even after &apos;lfs pcc state&apos; command.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[root@c01 ~]# echo 3 &amp;gt; /proc/sys/vm/drop_caches 
[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: none
file: /ai400/proj100/f.1.0, type: none
file: /ai400/proj100/f.2.0, type: none
file: /ai400/proj100/f.3.0, type: none
file: /ai400/proj100/f.4.0, type: none
file: /ai400/proj100/f.5.0, type: none
file: /ai400/proj100/f.6.0, type: none
file: /ai400/proj100/f.7.0, type: none

[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: none
file: /ai400/proj100/f.1.0, type: none
file: /ai400/proj100/f.2.0, type: none
file: /ai400/proj100/f.3.0, type: none
file: /ai400/proj100/f.4.0, type: none
file: /ai400/proj100/f.5.0, type: none
file: /ai400/proj100/f.6.0, type: none
file: /ai400/proj100/f.7.0, type: none
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;server and client are running rc2 build &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[root@c01 ~]# clush -w c01,es400nv-vm1 lctl get_param version
es400nv-vm1: version=2.13.0_RC2
c01: version=2.13.0_RC2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="259157" author="gerrit" created="Wed, 4 Dec 2019 14:59:08 +0000"  >&lt;p&gt;Yingjin Qian (qian@ddn.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36923&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36923&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13030&quot; title=&quot;pcc: auto_attach doesn&amp;#39;t work after client cache cleared&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13030&quot;&gt;&lt;del&gt;LU-13030&lt;/del&gt;&lt;/a&gt; pcc: Init saved dataset flags wrongly&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a1f3b70af6c5b400df8e16219748b0ad2cc777da&lt;/p&gt;</comment>
                            <comment id="259159" author="sihara" created="Wed, 4 Dec 2019 15:03:42 +0000"  >&lt;p&gt;Yingjin found a root cause and he advised me the following fix.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
index 36e34ed092..54a0db1fb6 100644
--- a/lustre/llite/llite_lib.c
+++ b/lustre/llite/llite_lib.c
@@ -1007,7 +1007,7 @@ void ll_lli_init(struct ll_inode_info *lli)
                mutex_init(&amp;amp;lli-&amp;gt;lli_pcc_lock);
                lli-&amp;gt;lli_pcc_state = PCC_STATE_FL_NONE;
                lli-&amp;gt;lli_pcc_inode = NULL;
-               lli-&amp;gt;lli_pcc_dsflags = PCC_DATASET_NONE;
+               lli-&amp;gt;lli_pcc_dsflags = PCC_DATASET_INVALID;
                lli-&amp;gt;lli_pcc_generation = 0;
                mutex_init(&amp;amp;lli-&amp;gt;lli_group_mutex);
                lli-&amp;gt;lli_group_users = 0;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I&apos;ve just confirmed this fix solved original problem finally! here is results. even after multiple drop caches on clients, pcc state is back again automatically after &quot;lfs pcc state&quot; command.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;/work/tools/bin/fio -name=randread -ioengine=sync -rw=randread -blocksize=4k -iodepth=1 -direct=1 -size=100m -runtime=10 -numjobs=8 -group_reporting -directory=/ai400/proj100 -create_serialize=0 -filename_format=&apos;f.$jobnum.$filenum&apos;

[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: readwrite, PCC file: /0009/0000/0401/0000/0002/0000/0x200000401:0x9:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.1.0, type: readwrite, PCC file: /000a/0000/0401/0000/0002/0000/0x200000401:0xa:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.2.0, type: readwrite, PCC file: /0003/0000/0401/0000/0002/0000/0x200000401:0x3:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.3.0, type: readwrite, PCC file: /0004/0000/0401/0000/0002/0000/0x200000401:0x4:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.4.0, type: readwrite, PCC file: /0008/0000/0401/0000/0002/0000/0x200000401:0x8:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.5.0, type: readwrite, PCC file: /0005/0000/0401/0000/0002/0000/0x200000401:0x5:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.6.0, type: readwrite, PCC file: /0006/0000/0401/0000/0002/0000/0x200000401:0x6:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.7.0, type: readwrite, PCC file: /0007/0000/0401/0000/0002/0000/0x200000401:0x7:0x0, user number: 0, flags: 0
[root@c01 ~]# echo 3 &amp;gt; /proc/sys/vm/drop_caches 
[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: readwrite, PCC file: /0009/0000/0401/0000/0002/0000/0x200000401:0x9:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.1.0, type: readwrite, PCC file: /000a/0000/0401/0000/0002/0000/0x200000401:0xa:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.2.0, type: readwrite, PCC file: /0003/0000/0401/0000/0002/0000/0x200000401:0x3:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.3.0, type: readwrite, PCC file: /0004/0000/0401/0000/0002/0000/0x200000401:0x4:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.4.0, type: readwrite, PCC file: /0008/0000/0401/0000/0002/0000/0x200000401:0x8:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.5.0, type: readwrite, PCC file: /0005/0000/0401/0000/0002/0000/0x200000401:0x5:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.6.0, type: readwrite, PCC file: /0006/0000/0401/0000/0002/0000/0x200000401:0x6:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.7.0, type: readwrite, PCC file: /0007/0000/0401/0000/0002/0000/0x200000401:0x7:0x0, user number: 0, flags: 0
[root@c01 ~]# echo 3 &amp;gt; /proc/sys/vm/drop_caches 
[root@c01 ~]# lfs pcc state /ai400/proj100/f.*
file: /ai400/proj100/f.0.0, type: readwrite, PCC file: /0009/0000/0401/0000/0002/0000/0x200000401:0x9:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.1.0, type: readwrite, PCC file: /000a/0000/0401/0000/0002/0000/0x200000401:0xa:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.2.0, type: readwrite, PCC file: /0003/0000/0401/0000/0002/0000/0x200000401:0x3:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.3.0, type: readwrite, PCC file: /0004/0000/0401/0000/0002/0000/0x200000401:0x4:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.4.0, type: readwrite, PCC file: /0008/0000/0401/0000/0002/0000/0x200000401:0x8:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.5.0, type: readwrite, PCC file: /0005/0000/0401/0000/0002/0000/0x200000401:0x5:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.6.0, type: readwrite, PCC file: /0006/0000/0401/0000/0002/0000/0x200000401:0x6:0x0, user number: 0, flags: 0
file: /ai400/proj100/f.7.0, type: readwrite, PCC file: /0007/0000/0401/0000/0002/0000/0x200000401:0x7:0x0, user number: 0, flags: 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Thanks Yingijin for your prompt fix!&lt;/p&gt;</comment>
                            <comment id="259179" author="gerrit" created="Thu, 5 Dec 2019 06:55:51 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36923/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36923/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13030&quot; title=&quot;pcc: auto_attach doesn&amp;#39;t work after client cache cleared&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13030&quot;&gt;&lt;del&gt;LU-13030&lt;/del&gt;&lt;/a&gt; pcc: Init saved dataset flags properly&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: e467a421c7aa175b9316f4ee78f392050d2f587f&lt;/p&gt;</comment>
                            <comment id="259192" author="pjones" created="Thu, 5 Dec 2019 13:13:56 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i00q5z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>