datto / dattobd

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
576 stars 122 forks source link

Snapshot changes with snapshot origin #16

Closed uroni closed 8 years ago

uroni commented 8 years ago

Steps to reproduce (with dattobd 0.8.10, kernel 3.10.0-327.4.4.el7.x86_6):

rm /tmp/test.db || true
echo "CREATE TABLE test (tmp TEXT); INSERT INTO test (tmp) VALUES ('test1');" | sqlite3 /tmp/test.db
dbdctl setup-snapshot /dev/vda1 /.datto 0
mkdir -p /mnt/snap
mount /dev/datto0 /mnt/snap -o ro,norecovery
echo "SELECT * FROM test;" | sqlite3 /mnt/snap/tmp/test.db
echo "UPDATE test SET tmp='test2';" | sqlite3 /tmp/test.db
echo 1 > /proc/sys/vm/drop_caches
echo "SELECT * FROM test;" | sqlite3 /mnt/snap/tmp/test.db
echo "UPDATE test SET tmp='test3';" | sqlite3 /tmp/test.db
echo "SELECT * FROM test;" | sqlite3 /mnt/snap/tmp/test.db
echo 1 > /proc/sys/vm/drop_caches
echo "SELECT * FROM test;" | sqlite3 /mnt/snap/tmp/test.db
umount /mnt/snap
dbdctl destroy 0

Expected output: 4x test1

Actual output: test1 test2 test2 test3

uroni commented 8 years ago

It has the expected output if I run it locally in VitualBox (same kernel).

This is on a KVM guest (digitalocean).

tcaputi commented 8 years ago

confirmed the issue on my machine. working on a fix.

tcaputi commented 8 years ago

Fixed in most recent commit: b2e1c54f4a22bb185940468143a76dfb4572a7b3