New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asynchronous replica command [CORE6010] #6260
Comments
Commented by: @dyemanov If some utility would be to able to apply the journal segment immediately (by explicit command), would this solve your goal? |
Commented by: hugo (hugolarson) Sounds like right. One of FB strengths is that an entire DB is just one file which can be accessed and moved around very easily with zero configuration. I think this philosophy should be kept with replica feature if possible. |
Hi, |
We have the same problem. Our user's can create as many databases as they need with our GUI. They haven't got knowledge to edit config files and it is impossible to restart the server while, users are using other databases. |
Such a solution would be very useful for us. (Hundreds of databases in continuous operation.) I intended the below description to be thought-provoking. Asynchronous replication of existing databases with continuously running Firebird (thoughts) Prerequisites:
Master side: M1. At the database level, we should indicate that we are setting up a new asynchronous replication (e.g. test_sync1) M2. The next step is to be able to set up the data required for asynchronous synchronization (the commands can only be used between step M1 and M3) This parameters should be accessable via read only system table, e.g. This parameters should be updateable only before M3 step is activated. M3. Activate the test_sync1 replication: At this point
Then the DBA can copy the database to the replica side and configure the replica there. M4. After database copy is ready to the replica side DBA be able to merge the delta file: At this point the engine should merge the nbakcup delta file and continuously write the async log files. Replica side: R1. After step M3 with a copy command we have the database file on replica side. R2. We should configure the replica side: DBA should go the tasks to provide the replica log files the the right place. R3. DBA activate the replica side: ( If once the replication was started, it will stop and it can be restarted by step M3 and M4, if not its configuration will droped immediately by stop command. rdb$async_name.rdb$async_state:
András edit 1.: gbak should not backup the rdb$async table, if someone restore the database this kind of replication should be set up again. |
First of all, replication may be started/stopped without restarting the Firebird server. However, if configuration is changed, then all users should be re-connected to take it into account. With #6977 implemented, I think this would not be required. Then, Firebird is not "zero configuration", it may just be used that way. With lots of databases in operation, you either rely on default configuration options, or setup specific configuration that's shared by all databases. Note that you don't set any options via DDL! Mostly the same approach is used for replication. Almost all settings has reasonable defaults and may be specified for all replicated databases at once. The major difference is that replication also needs target paths that are usually database-specific and here per-database configuration becomes mandatory and this starts causing problems for you. Let's see what could be done in this regard:
I don't like storing paths inside the database as it makes it not relocatable. Think about UDFs/UDRs or external files, for example - we allow to store only their names but the full path is resolved using firebird.conf (UdfAccess, ExternalFIleAccess). Even if these settings are to be ignored by gbak, they will still be preserved by nbackup or physical file copying. Regarding M3, I see the point. But I don't think that starting replication always require a database copy to be transferred to the replica side, at least immediately. And given that M4 has nothing specific to replication and does the same as ALTER DATABASE END BACKUP, I'd suggest to just run ENABLE PUBLICATION, then BEGIN BACKUP (immediately or on demand), then END BACKUP (when copy is ready). |
Hi! Also a user with hundreds of databases in 2.5 looking to migrate to 4.0 in the future. Alternatively maybe the journal files should be prefixed with database name or guid. There is a setting |
Journal files are prefixed with the database name by default, |
That doesn't seem to be the case. In the config the prefix is per default unspecified (commented out):
I'm using the default replication.conf with only the paths specified. |
@mrgleba, could you please specify exactly the |
replication.conf:
The file is on a local filesystem |
It should look like |
I've tried with a general config only. As I understand the general config should work: the journal_directory would be common and the journal files |
Funny. I was sure this is prohibited, but it seems likely to work, provided that the missing db name prefix is fixed. |
Database file name might cause collisions. |
I can confirm the primary side can work without per-database configuration settings. However, it's still impossible on the replica side, making the whole effort rather pointless. |
Actually it'd still be very valuable:
Now we do nbackup at intervals to achieve incremental backup/point in time restore. This change could simplify our operations |
OK, I will consider including the fix into the next v4 post-release. |
Submitted by: hugo (hugolarson)
Hi,
We have several hundreds of FB databases running on computers who needs to be backupped to our server.
We use today FB 2.5 with nbackup and transport the N files over HTTP.
Looking at the new replica feature with great anticipation which will improve our backup procedures a lot.
I reacted on the way on setting replication on replica side one must put an entry for each FDB files in the replication.conf.
This cumbersome in our case because we have hundreds of FDB files. Also the need to restart the engine every time is problematic.
I thought of a way to apply the incoming journal files to the FDB's when they are actually transported instead of the engine looking for files in the incoming folder all the time.
A bit like how the nbackup restore is used. No configuration and no need to restart FB. Ultimately with Jaybird JDBC.
Thanks,
Hugo
The text was updated successfully, but these errors were encountered: