<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>59767</bug_id>
          
          <creation_ts>2026-07-08 17:43:28 +0300</creation_ts>
          <short_desc>Патч 0001-afr_selfheal_do-return-EIO-if-inode-type-is-not-IA_I.patch ломает self-heal директорий</short_desc>
          <delta_ts>2026-10-10 10:16:12 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>glusterfs11</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vladimir Avtsenov">vladimir.lsk.cool</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          <cc>amakeenk</cc>
    
    <cc>antohami</cc>
    
    <cc>cas</cc>
    
    <cc>eltsovga</cc>
    
    <cc>lav</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>290871</commentid>
    <comment_count>0</comment_count>
    <who name="Vladimir Avtsenov">vladimir.lsk.cool</who>
    <bug_when>2026-07-08 17:43:28 +0300</bug_when>
    <thetext>Во всех пакетах, связанных с glusterfs (от glusterfs9 до glusterfs11), присутствует патч &quot;0001-afr_selfheal_do-return-EIO-if-inode-type-is-not-IA_I.patch&quot;. В его описании содержится ссылка на GitHub Issue:

https://github.com/gluster/glusterfs/issues/1129

При этом данный Issue относится к GlusterFS 7.4.

По какой-то причине этот патч был добавлен не в ветку GlusterFS 7.x (или 8.x), к которой относится указанный Issue, а в GlusterFS 9.x и продолжает присутствовать вплоть до текущей мажорной версии.

Проблема затрагивает все версии ALT Linux от P9 до P11, а также Sisyphus.

Основная проблема заключается в том, что данный патч ломает восстановление (self-heal) директорий при добавлении нового brick в уже существующий Volume.

Шаги для воспроизведения:

----------------------------------------------------------------------
# Создать и запустить Volume
gluster volume create shared-vol node01:/data/gluster/brick1 force
gluster volume start shared-vol

# Примонтировать Volume и создать папки/файлы внутри
mkdir -p /mnt/shared
echo &apos;localhost:/shared-vol /mnt/shared glusterfs defaults,_netdev,x-systemd.automount,x-systemd.mount-timeout=30 0 0&apos; &gt;&gt; /etc/fstab
mount /mnt/shared

ROOTDIR=/mnt/shared
for i in {1..8}; do
    mkdir -pv $ROOTDIR/dir$i;
    for j in {1..8}; do
        mkdir -pv $ROOTDIR/dir$i/dir$j;
        for k in {1..8}; do
            dd if=/dev/urandom of=$ROOTDIR/dir$i/dir$j/file$i.bin bs=1M count=1 status=progress;
        done
    done
done

# Добавить вторую ноду и подключить к ней Volume как реплику
gluster peer probe node02
gluster volume add-brick shared-vol replica 2 node02:/data/gluster/brick1 force
----------------------------------------------------------------------

Что происходит:

* Файлы изначально не синхронизируются. Им нужен дополнительный &quot;пинок&quot; командой &quot;find /mnt/shared -type f&quot;.
* Корневая директория &quot;/&quot; сразу после выполнения команды &quot;gluster volume add-brick&quot; остается в состоянии heal.
* При попытке выполнить:

----------------------------------------------------------------------
gluster volume heal shared-vol granular-entry-heal enable
----------------------------------------------------------------------

получаю ошибку:

----------------------------------------------------------------------
One or more entries need heal. Please execute the command again after there are no entries to be healed
Volume heal failed.
----------------------------------------------------------------------

* При выполнении:

----------------------------------------------------------------------
find /mnt/shared -type d | head -30
----------------------------------------------------------------------

(либо даже обычного &quot;ls&quot; в примонтированном Volume) возникает рассинхронизация директорий (но не файлов), что подтверждается выводом:

----------------------------------------------------------------------
gluster volume heal shared-vol info
----------------------------------------------------------------------

* В журнале &quot;/var/log/glusterfs/glustershd.log&quot; появляется сообщение, которое было добавлено именно рассматриваемым патчем:

----------------------------------------------------------------------
E [MSGID: 108056] [afr-self-heal-common.c:2559:afr_selfheal_do] 0-shared-vol-replicate-0: TYPE mismatch 2 vs 1 (IA_IFREG) for gfid:00000000-0000-0000-0000-000000000001
----------------------------------------------------------------------

Запись воспроизведения проблемы:

https://asciinema.org/a/fpqkM1ZTl1Mybhmi

Левая половина экрана - node01, правая - node02.
В нижней части обеих половин выполняется:

----------------------------------------------------------------------
watch -n1 gluster volume heal shared-vol info
----------------------------------------------------------------------

Предлагаемое решение:

Удалить либо исправить патч &quot;0001-afr_selfheal_do-return-EIO-if-inode-type-is-not-IA_I.patch&quot;, поскольку именно после его применения возникает описанное поведение.

Ожидаемое поведение:

После удаления данного патча из сборки проблема должна исчезнуть.

В частности:

* Команда

----------------------------------------------------------------------
gluster volume heal shared-vol granular-entry-heal enable
----------------------------------------------------------------------

должна выполняться без ошибок.

* После выполнения

----------------------------------------------------------------------
gluster volume add-brick shared-vol ...
----------------------------------------------------------------------

heal должен начинаться сразу, без зависания корневой директории.

* Команда

----------------------------------------------------------------------
find /mnt/shared -type d | head -30
----------------------------------------------------------------------

не должна приводить к рассинхронизации директорий.

* В журнале &quot;/var/log/glusterfs/glustershd.log&quot; больше не должно появляться сообщение:

----------------------------------------------------------------------
TYPE mismatch 2 vs 1 (IA_IFREG)
----------------------------------------------------------------------

Для сравнения запись работы glusterfs после удаления данного патча:

https://asciinema.org/a/aD3ngyGeremqg69L</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>290879</commentid>
    <comment_count>1</comment_count>
    <who name="Vladimir Avtsenov">vladimir.lsk.cool</who>
    <bug_when>2026-07-08 18:14:26 +0300</bug_when>
    <thetext>Забыл добавить, что проблема затрагивает не только GlusterFS 9.X (на P10), но и GlusterFS 11.X (Sisyphus), т.к. этот патч присутствует во всех этих версиях GlusterFS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>301382</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2026-10-07 09:19:12 +0300</bug_when>
    <thetext>Спасибо за подробный разбор и записи воспроизведения!

Исправление готово: https://git.altlinux.org/tasks/435696/
- glusterfs11 обновлён до 11.2-alt1;
- патч 0001-afr_selfheal_do-return-EIO-if-inode-type-is-not-IA_I.patch удалён;

glusterfs11 больше не собирается на i586 (в 11.2 нужны 64-битные атомарные операции liburcu), поэтому в то же задание добавлены fio, samba и scsitarget-utils с отключённым glusterfs на i586.

Сценарий из бага проверен на двух нодах в контейнерах (volume с 64 каталогами и 256 файлами, затем add-brick replica 2):
- на 11.1-alt2 все 73 каталога так и остаются в heal, в glustershd.log &quot;TYPE mismatch 2 vs 1 (IA_IFREG)&quot;;
- на 11.2-alt1 heal проходит полностью за несколько секунд, &quot;granular-entry-heal enable&quot; выполняется без ошибок, содержимое брик совпадает.

Задание ждёт подтверждения от мейнтейнеров fio и samba.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>301663</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2026-10-10 10:16:12 +0300</bug_when>
    <thetext>glusterfs11-11.2-alt1 -&gt; sisyphus:

Tue Oct 06 2026 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 11.2-alt1
- new version 11.2
- drop afr_selfheal_do patch breaking directory self-heal (closes: #59767)
- build with libuserspace-rcu &gt;= 0.15.7-alt2 (64-bit uatomic on i586)
- fix Conflicts with glusterfs{8,9,10}-georeplication
- move mount.glusterfs and umount.glusterfs to /usr/sbin
- server: skip autoreqs from glusterd hook scripts (they run only for
  the configured integrations): drops hard deps on samba (/usr/sbin/smbd),
  dbus-tools (ganesha hook), openssh-clients/scp (geo-replication hook),
  policycoreutils, libselinux-utils, attr, which
- server: skip autoreqs from control-cpu-load.sh/control-mem.sh
  (manual cgroup helpers): drops hard dep on /bin/systemctl
- fix removal of the selinux hooks moved to add-brick/post
- drop removal of /etc/init.d/glusterd (not installed anymore),
  use rm -v without -f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>