Replies: 1 comment 5 replies
-
Hi @tutiplain, I think you have a good understanding on how replication works. Although, there are some details which my lead to the situation you are describing "Failed to replicate transaction XXX..." when the replica started with an existent data folder. When immudb starts, it creates two databases Switching from master and replica back and forth should work fine as long the history of transaction is kept consistent. One instance ahead of others, but txs shouldn't diverge, this situation could happen when instances set as master commit transactions and then replication is attempted. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I am running ImmuDB in a network and using two different machines as replicas (the two machines are part of the same network).
I am starting the master database with the following CLI command:
/immudb --web-server-port=8081 --dir /data/immu_data
The replicas are being started with this command:
/immudb --web-server-port=8081 --replication-enabled --replication-follower-username=immudb --replication-follower-password=immudb --port=3323 --pgsql-server=false --replication-master- --dir /data/immu_data
This works fine. What I'd like to do is have one of my replicas start up as the new master database, and then have a new replica come up on yet another machine on the network. I already have a project that handles this and succesfully boots the old replica as the new master and creates a new replica elsewhere. The folder where the data is stored is never deleted, so there is a chance that a previous master will become a master again, but have an outdated data folder. And there is a chance that a replica might be created on a machine that already had data in it. When this happens, the replica process starting displaying this message: "Failed to replicate transaction XXX. Reason: illegal arguments". If a replica showing this message becomes the leader again, its data will be incomplete. I looked at the immudb code and, apparently the "illegal arguments" message means there is something invalid in the command line arguments. However, the command line I am using to start the replica works for the initial replica (and I have validated that the new master's address is correct). My question is: why do these "Failed to replicate tx" messages mean and how can I keep fix them? If the previous folder is deleted, the replica runs fine, but I figure the replica creation will take longer as the data size increases over time, so I'd like for the replica to use the existing folder and just... catch up to the most recent transaction. Maybe I'm misunderstanding how the whole replication thing works. Any help or info on this would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions