{"id":3842,"date":"2025-12-27T15:48:30","date_gmt":"2025-12-27T14:48:30","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3842"},"modified":"2026-01-22T00:47:11","modified_gmt":"2026-01-21T23:47:11","slug":"qcow2-snapshots-leading-to-data-corruption-in-kvm-libvirt-from-debian-trixie","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2025\/12\/qcow2-snapshots-leading-to-data-corruption-in-kvm-libvirt-from-debian-trixie\/","title":{"rendered":"qcow2 snapshots leading to data corruption in KVM + libvirt coming from Debian Trixie?"},"content":{"rendered":"\n<p>i don&#8217;t have any reproducible scenario, but i want to leave this one out in the open. maybe someone else experiences similar issue?<\/p>\n\n\n\n<p>after upgrading both OS on the physical servers and under VMs to Debian Trixie i&#8217;ve experienced 4 database corruptions &#8211; both under MySQL 5.8.4 and PostgreSQL 17, on different physical servers. it&#8217;s something i have not seen in the past at such scale, in such a short period of time [ ~4 months ].<\/p>\n\n\n\n<p>what i&#8217;ve seen in MySQL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2025-12-14T20:31:28.026983Z 82383692 &#91;ERROR] &#91;MY-013183] &#91;InnoDB] Assertion failure: btr0pcur.cc:339:cur_page == prev_of_next thread 140504756078272\nInnoDB: We intentionally generate a memory trap.\nInnoDB: Submit a detailed bug report to http:\/\/bugs.mysql.com.\nInnoDB: If you get repeated assertion failures or crashes, even\nInnoDB: immediately after the mysqld startup, there may be\nInnoDB: corruption in the InnoDB tablespace. Please refer to\nInnoDB: http:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/forcing-innodb-recovery.html\nInnoDB: about forcing recovery.\n2025-12-14T20:31:28Z UTC - mysqld got signal 6 ;\nMost likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.\nBuildID&#91;sha1]=a63fbd129f41632f3d0a68a68702da454aaf928d\nThread pointer: 0x7fc0f4056250\nAttempting backtrace. You can use the following information to find out\nwhere mysqld died. If you see no messages after this, something went\nterribly wrong...\nstack_bottom = 7fc9d0133b70 thread_stack 0x100000\n #0 0x55db410d8ce1 &lt;unknown&gt;\n #1 0x55db410d928e &lt;unknown&gt;\n #2 0x55db4223d889 &lt;unknown&gt;\n #3 0x55db4249e884 &lt;unknown&gt;\n #4 0x55db424e7fe7 &lt;unknown&gt;\n #5 0x55db42411d77 &lt;unknown&gt;\n #6 0x55db4241b65e &lt;unknown&gt;\n #7 0x55db422afb4f &lt;unknown&gt;\n #8 0x55db411fa476 &lt;unknown&gt;\n #9 0x55db4134e0b0 &lt;unknown&gt;\n #10 0x55db4147a96c &lt;unknown&gt;\n #11 0x55db40fc6c5e &lt;unknown&gt;\n #12 0x55db40f621a0 &lt;unknown&gt;\n #13 0x55db40f65c2c &lt;unknown&gt;\n #14 0x55db40f6854d &lt;unknown&gt;\n #15 0x55db40f69125 &lt;unknown&gt;\n #16 0x55db410c8fb7 &lt;unknown&gt;\n #17 0x55db4298a833 &lt;unknown&gt;\n #18 0x7fcf2a46fb7a &lt;unknown&gt;\n #19 0x7fcf2a4ed7b7 &lt;unknown&gt;\n #20 0xffffffffffffffff &lt;unknown&gt;\n\nTrying to get some variables.\nSome pointers may be invalid and cause the dump to abort.\nQuery (7fc0f44a6ec0): \/* ApplicationName=DBeaver 25.2.4 - SQLEditor &lt;DBNAME.TABLENAME&gt; *\/ delete  FROM DBNAME.TABLENAME where EntityUpdateType  = 3\nConnection ID (thread ID): 82383692\nStatus: NOT_KILLED\n\nThe manual page at http:\/\/dev.mysql.com\/doc\/mysql\/en\/crashing.html contains\ninformation that should help you find out what is causing the crash.\n2025-12-14T20:31:28.026984Z 0 &#91;System] &#91;MY-013951] &#91;Server] 2025-12-14T20:31:28Z UTC - mysqld got signal 6 ;\n2025-12-14T20:31:28.026985Z 0 &#91;System] &#91;MY-013951] &#91;Server] Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.\n2025-12-14T20:31:28.026986Z 0 &#91;System] &#91;MY-013951] &#91;Server] BuildID&#91;sha1]=a63fbd129f41632f3d0a68a68702da454aaf928d\n2025-12-14T20:31:28.026987Z 0 &#91;System] &#91;MY-013951] &#91;Server] Thread pointer: 0x7fc0f4056250\n2025-12-14T20:31:28.026988Z 0 &#91;System] &#91;MY-013951] &#91;Server] Attempting backtrace. You can use the following information to find out\n2025-12-14T20:31:28.026989Z 0 &#91;System] &#91;MY-013951] &#91;Server] where mysqld died. If you see no messages after this, something went\n2025-12-14T20:31:28.026990Z 0 &#91;System] &#91;MY-013951] &#91;Server] terribly wrong...\n2025-12-14T20:31:28.026991Z 0 &#91;System] &#91;MY-013951] &#91;Server] stack_bottom = 7fc9d0133b70 thread_stack 0x100000\n2025-12-14T20:31:28.026992Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #0 0x55db410d8ce1 &lt;unknown&gt;\n2025-12-14T20:31:28.026993Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #1 0x55db410d928e &lt;unknown&gt;\n2025-12-14T20:31:28.026994Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #2 0x55db4223d889 &lt;unknown&gt;\n2025-12-14T20:31:28.026995Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #3 0x55db4249e884 &lt;unknown&gt;\n2025-12-14T20:31:28.026996Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #4 0x55db424e7fe7 &lt;unknown&gt;\n2025-12-14T20:31:28.026997Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #5 0x55db42411d77 &lt;unknown&gt;\n2025-12-14T20:31:28.026998Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #6 0x55db4241b65e &lt;unknown&gt;\n2025-12-14T20:31:28.026999Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #7 0x55db422afb4f &lt;unknown&gt;\n2025-12-14T20:31:28.027000Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #8 0x55db411fa476 &lt;unknown&gt;\n2025-12-14T20:31:28.027001Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #9 0x55db4134e0b0 &lt;unknown&gt;\n2025-12-14T20:31:28.027002Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #10 0x55db4147a96c &lt;unknown&gt;\n2025-12-14T20:31:28.027003Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #11 0x55db40fc6c5e &lt;unknown&gt;\n2025-12-14T20:31:28.027004Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #12 0x55db40f621a0 &lt;unknown&gt;\n2025-12-14T20:31:28.027005Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #13 0x55db40f65c2c &lt;unknown&gt;\n2025-12-14T20:31:28.027006Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #14 0x55db40f6854d &lt;unknown&gt;\n2025-12-14T20:31:28.027007Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #15 0x55db40f69125 &lt;unknown&gt;\n2025-12-14T20:31:28.027008Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #16 0x55db410c8fb7 &lt;unknown&gt;\n2025-12-14T20:31:28.027009Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #17 0x55db4298a833 &lt;unknown&gt;\n2025-12-14T20:31:28.027010Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #18 0x7fcf2a46fb7a &lt;unknown&gt;\n2025-12-14T20:31:28.027011Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #19 0x7fcf2a4ed7b7 &lt;unknown&gt;\n2025-12-14T20:31:28.027012Z 0 &#91;System] &#91;MY-013951] &#91;Server]  #20 0xffffffffffffffff &lt;unknown&gt;\n2025-12-14T20:31:28.027013Z 0 &#91;System] &#91;MY-013951] &#91;Server] Trying to get some variables.\n2025-12-14T20:31:28.027014Z 0 &#91;System] &#91;MY-013951] &#91;Server] Some pointers may be invalid and cause the dump to abort.\n2025-12-14T20:31:28.027015Z 0 &#91;System] &#91;MY-013951] &#91;Server] Query (7fc0f44a6ec0): \/* ApplicationName=DBeaver 25.2.4 - SQLEditor &lt;DBNAME.TABLENAME&gt; *\/ delete  FROM DBNAME.TABLENAME where EntityUpdateType  = 3\n2025-12-14T20:31:28.027016Z 0 &#91;System] &#91;MY-013951] &#91;Server] Connection ID (thread ID): 82383692\n2025-12-14T20:31:28.027017Z 0 &#91;System] &#91;MY-013951] &#91;Server] Status: NOT_KILLED\n2025-12-14T20:31:28.027018Z 0 &#91;System] &#91;MY-013951] &#91;Server] The manual page at http:\/\/dev.mysql.com\/doc\/mysql\/en\/crashing.html contains\n2025-12-14T20:31:28.027019Z 0 &#91;System] &#91;MY-013951] &#91;Server] information that should help you find out what is causing the crash.\n2025-12-14T20:31:29.025290Z 0 &#91;System] &#91;MY-015015] &#91;Server] MySQL Server - start.\n<\/code><\/pre>\n\n\n\n<p>another case in MySQL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2026-01-05T10:36:56.139551Z 260899 &#91;ERROR] &#91;MY-012153] &#91;InnoDB] Trying to access page number 4264257694 in space 248603, space name DBNAME\/TABLENAME, which is outside the tablespace bounds. Byte offset 0, len 16384, i\/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.\n2026-01-05T10:36:56.139623Z 260899 &#91;ERROR] &#91;MY-012154] &#91;InnoDB] Server exits.\n2026-01-05T10:36:56.139633Z 260899 &#91;ERROR] &#91;MY-013183] &#91;InnoDB] Assertion failure: fil0fil.cc:7541 thread 140658412197568\nInnoDB: We intentionally generate a memory trap.\nInnoDB: Submit a detailed bug report to http:\/\/bugs.mysql.com.\nInnoDB: If you get repeated assertion failures or crashes, even\nInnoDB: immediately after the mysqld startup, there may be\nInnoDB: corruption in the InnoDB tablespace. Please refer to\nInnoDB: http:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/forcing-innodb-recovery.html\nInnoDB: about forcing recovery.\n2026-01-05T10:36:56Z UTC - mysqld got signal 6 ;\nMost likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.\nBuildID&#91;sha1]=a63fbd129f41632f3d0a68a68702da454aaf928d\nThread pointer: 0x7fe65c018480\nAttempting backtrace. You can use the following information to find out\nwhere mysqld died. If you see no messages after this, something went\nterribly wrong...\nstack_bottom = 7fed96b18b70 thread_stack 0x100000\n #0 0x55d918950ce1 &lt;unknown&gt;\n #1 0x55d91895128e &lt;unknown&gt;\n #2 0x55d919ab5889 &lt;unknown&gt;\n #3 0x55d919d16884 &lt;unknown&gt;\n #4 0x55d919e7acdd &lt;unknown&gt;\n #5 0x55d919e98975 &lt;unknown&gt;\n #6 0x55d919e989fd &lt;unknown&gt;\n #7 0x55d919db983b &lt;unknown&gt;\n #8 0x55d919db9c35 &lt;unknown&gt;\n #9 0x55d919d707dd &lt;unknown&gt;\n #10 0x55d919d7ced7 &lt;unknown&gt;\n #11 0x55d919d7cfc0 &lt;unknown&gt;\n #12 0x55d919d7de51 &lt;unknown&gt;\n #13 0x55d919f00732 &lt;unknown&gt;\n #14 0x55d919f010c3 &lt;unknown&gt;\n #15 0x55d919b81290 &lt;unknown&gt;\n #16 0x55d919c8c10e &lt;unknown&gt;\n #17 0x55d919c8cb3f &lt;unknown&gt;\n #18 0x55d919c95c37 &lt;unknown&gt;\n #19 0x55d919b27b4f &lt;unknown&gt;\n #20 0x55d918a72361 &lt;unknown&gt;\n #21 0x55d918bc60b0 &lt;unknown&gt;\n #22 0x55d9188b4baf &lt;unknown&gt;\n #23 0x55d9188b4f3b &lt;unknown&gt;\n #24 0x55d918833dba &lt;unknown&gt;\n #25 0x55d91883ec5e &lt;unknown&gt;\n #26 0x55d9187da1a0 &lt;unknown&gt;\n #27 0x55d9187ddc2c &lt;unknown&gt;\n #28 0x55d9187e054d &lt;unknown&gt;\n #29 0x55d9187e1125 &lt;unknown&gt;\n #30 0x55d918940fb7 &lt;unknown&gt;\n #31 0x55d91a202833 &lt;unknown&gt;\n #32 0x7ff05629cb7a start_thread at .\/nptl\/pthread_create.c:448\n #33 0x7ff05631a7b7 __clone3 at sysdeps\/unix\/sysv\/linux\/x86_64\/clone3.S:78\n #34 0xffffffffffffffff &lt;unknown&gt;\n\nTrying to get some variables.\nSome pointers may be invalid and cause the dump to abort.\nQuery (7fe65c3985b0): SELECT \/*!40001 SQL_NO_CACHE *\/ * FROM `TABLENAME`\nConnection ID (thread ID): 260899\nStatus: NOT_KILLED\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>in PostgreSQL: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2025-12-14 22:56:43.054 UTC &#91;1441945] postgres@application_cache ERROR:&nbsp; unexpected chunk number 2 (expected 0) for toast value 294783547 in pg_toast_82860713\n2025-12-14 22:56:43.054 UTC &#91;1441945] postgres@application_cache STATEMENT:&nbsp; COPY public.generic_storage (id, content_type, model_type, content_updated_date, stored_date, content_data, data_source) TO stdout;<\/code><\/pre>\n\n\n\n<p>what do both servers have in common? both are running as KVM vms, i&#8217;m taking VM-level snapshots of both &#8211; by running on the virtualization host:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>virsh snapshot-create-as --domain VMNAME --name \"kvmsnap-VMNAME\" --no-metadata --atomic --disk-only vdX,external<\/code><\/li>\n\n\n\n<li>executing rsync to fetch the vdX.qcow2 to another server<\/li>\n\n\n\n<li><code>virsh blockcommit VMNAME vdX--active --pivot --verbose<\/code><\/li>\n\n\n\n<li>deleting the snapshot files from directories where the qcow2 files are kept for VMs<\/li>\n<\/ul>\n\n\n\n<p>all corruptions that i&#8217;ve experienced happened soon after VM-level backup was executed; during backup VMs were under heavy read&amp;write loads.<\/p>\n\n\n\n<p>i&#8217;ve searched for similar cases but could not find anything relevant. the closest i could find is a mention of bug fix present in libvirt 11:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>qemu: set detect_zeroes for all backing chain layers\n\nSome block jobs (snapshots, block commit) could modify the backing chain in a way where detect_zeroes would no longer be honoured. We now set it for all images in the backing chain, so that it will behave correctly even after those operations<\/code><\/pre>\n\n\n\n<p>if you&#8217;ve experienced a similar issue &#8211; how did you solve it?<\/p>\n\n\n\n<p>i&#8217;ve moved snapshots of the most busy servers to less loaded database replicas.<\/p>\n\n\n\n<p>issue reported to the qemu project &#8211; <a href=\"https:\/\/gitlab.com\/qemu-project\/qemu\/-\/issues\/3273\">https:\/\/gitlab.com\/qemu-project\/qemu\/-\/issues\/3273<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>i don&#8217;t have any reproducible scenario, but i want to leave this one out in the open. maybe someone else experiences similar issue? after upgrading both OS on the physical servers and under VMs to Debian Trixie i&#8217;ve experienced 4 database corruptions &#8211; both under MySQL 5.8.4 and PostgreSQL 17, on different physical servers. it&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[49,50],"class_list":["post-3842","post","type-post","status-publish","format-standard","hentry","category-tech","tag-kvm","tag-libvirt"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3842"}],"version-history":[{"count":5,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3842\/revisions"}],"predecessor-version":[{"id":3858,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3842\/revisions\/3858"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}