Skip to content

First query always fail on renamed db when shadow is enabled #8638

@medvedo

Description

@medvedo

We are migrating from 2.5 to 5 and found this problem:

When name unchanged, all works as expected:

# echo "create shadow 1 manual '/mnt/backup/db_shadow/billing_shadow_test.fdb';" | isql-fb5 test.fdb
# echo "select count(*) from abonents;" | isql-fb5 test.fdb
                COUNT 
===================== 
                    6

But if we rename file (for maintenteance purposes), strange things are appears at first query:

# echo "drop shadow 1 ;" | isql-fb5 test.fdb
# mv test.fdb test-in-maintenance.fdb
# echo "create shadow 1 manual '/mnt/backup/db_shadow/billing_shadow_test.fdb';" | isql-fb5 test-in-maintenance.fdb 
# mv test-in-maintenance.fdb test.fdb
# echo "select count(*) from abonents;" | isql-fb5 test.fdb
Statement failed, SQLSTATE = 08001
I/O error during "open" operation for file "/mnt/var/root/DB/TT/test-in-maintenance.fdb"
-Error while trying to open file
-No such file or directory
Use CONNECT or CREATE DATABASE to specify a database
Use CONNECT or CREATE DATABASE to specify a database
# echo "select count(*) from abonents;" | isql-fb5 test.fdb
                COUNT 
===================== 
                    6

In SS mode, this bug is reproduced unclearly (may be single error as above, may be persistent error, may be all right), but it have significant side effect: settings in databases.conf not applied to database until daemon is restarted.

The error seems to appear more often in large databases: isql quickly returns some kind of open or write error, but the file is created and allocated (available space and permissions have been checked, of course), and db becomes unavailable until gfix -k

I/O error during "write" operation for file "/mnt/backup/db_shadow/billing_shadow.fdb"
        Error while trying to write to file
        Invalid argument

Some people think that shadow feature is not relevant at all, but when using SSD it is relevant again (especially for the first half of the joke about admins and backups).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions