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
Changes caused by ALTER DATABASE command are not replicated #8008
Comments
Most of the |
OK, but what about these:
-- ? |
Now I seem to recall the problem. Multiple options can be specified inside one ALTER DATABASE BEGIN BACKUP DROP LINGER SET DEFAULT CHARACTER SET win1251 DISABLE PUBLICATION; What should we do with this? ;-) |
This is why it's currently prohibited as a whole and replica must be re-initialized after "sensible" |
This is from doc:
IMO, only one option ('begin backup') must not be replicated ('add difference file' is atavism and not used). |
IMO, only /one/ option ('begin backup') must not be replicated ('add
difference file' is atavism and not used).
So, when 'alter database' is issued in mixed ('compound') form - why
this /single/ option can not be either prohibited or just be skipped
from replication ?
What do you mean with "atavism"? Do you mean legacy/deprecated?
It is not, the "difference file" is the delta file for when the database
is in backup mode (alter database begin backup, or making a backup with
nbackup), and sounds also like something which shouldn't be replicated.
|
I'd say these should be replicated: maybe also: not so sure about: the rest is physical database management and IMO should not be replicated. |
I made the mistake of confusing it with 'add_sec_clause'. |
IMO, this will be very useful for DBA when he changes replica DB to master. |
PS. and what about encryption ? |
Encryption IMHO should not be replicated, because replica security implications may be different from the master. DBA will need to re-encrypt the db after failover. |
If cascade replication is enabled and replica is read-write, disabling replication on the primary node will force it being disabled on the replica too, but there maybe replica-only modifications that still must be replicated further. So generally I don't think that |
Please create a separate ticket for this. |
Only
can be safely replicated. For |
On 2/16/24 12:14, Dmitry Yemanov wrote:
Anyway, it will be good if all options related to backup or adding
secondary file will be forced to use separately. Their usage
together with other options (DROP LINGER, SET DEFAULT CHARACTER
SET, etc) must be prohibited.
Please create a separate ticket for this.
I disagree with this change. It can break existing scripts.
What about replicating ALTER DB partially (not all options) - there is
simple solutio with rebuilding SQL statement based on replicated clauses.
|
Yes, I've already created the patch ;-) Just need to figure out what options it should handle. |
Make ALTER DATABASE to ignore some clauses if database is in replica mode IMHO. |
Maybe this gonna be more changes than the master-side solution mentioned above (too many clauses to add a check for) but I suppose it should look prettier. I will give it a try. |
I forgot to add "and issue a warning" to "ignore". DBA would be very confused if they try to execute ALTER DATABASE on replica and it silently do nothing. Also perhaps master should not try to omit replication of query that contain only would-be-ignored clauses because replication plugin or target server can have different opinion about it. |
Most (or all ?) changes caused by the 'ALTER DATABASE' command are not replicated.
Below are steps to reproduce on Windows (checked on 6.0.0.264).
Stop FB server.
Create folder
%FB_HOME%\examples\empbuild\qa_replication\
Create two databases and prepare them for work in replication. This is example of replication.conf:
Copy all files from
%FB_HOME%\examples\prebuilt\plugins\
to%FB_HOME%\plugins\
Add following lines in
%FB_HOME%\plugins\fbSampleKeyHolder.conf
Add parameter:
KeyHolderPlugin = fbSampleKeyHolder
in firebird.confStart FB server.
Ensure that there are no files c:\temp\tmp_result_1.log and c:\temp\tmp_result_2.log, and run following script:
Compare logs:
fc /w /n C:\temp\tmp_result_1.log C:\temp\tmp_result_2.log
Output will be:
PS.
Same for LINGER. Although this parameter does not affect anything, but it would be more convenient for DBAs that its value will be also replicated - just in case when replica becomes master because of hardware crash etc.
The text was updated successfully, but these errors were encountered: