Too many conflict files are created automatically?

I use syncthing to sync my database from web1 server to web2 server。web1 server is Folder Master.There are too many conflict files are created automatically to occupy my disk space 。Could you please tell me how to solve this problem?I’m chinese,forgive my poor English.Thanks a lot.

Under the advanced settings, per folder, there is a setting called “maxConflicts”. Set this to 1 for example, and only one conflict copy will be kept around.

(Or fix the source of your conflicts, as conflicts are usually a bad thing.)

Thank you for your reply very munch.I check the “maxConflicts” on my settings ,It’s “-1”,does it mean the mount of conflict files are unlimited? In what case the conflict files are created?

Yes, -1 is unlimited, but you will get in trouble for syncing a database. You shouldn’t do that.

Thank you for your reply very munch.I check the “maxConflicts” on my settings ,It’s “-1”,does it mean the mount of conflict files are unlimited? In what case the conflict files are created?My database is updating frequently everyday.About 200 datas are inserting in to my table everyhour.IS it the reason why the conflict files are created?

If the database gets modified on both sides simultaniously, that causes a conflict.

As I said, you are asking for trouble by syncing a database, you should not do that, you will corrupt it.

Use a native database replication method provided by the database software vendor.

Thank you for your reply very much:blush:I have set the web1 server as a Folder Master,And the database is modified only on web1 server.So,I still don’t understand why the conflict flies are created.My database is MySQL,databases are documents in MySQL.So I think if syncthing can sync documents,syncthing can also sync MySQL databases.

The fact that the database is not being written to does not mean that the database files are not getting modified. MySQL does various vacuums and compactions in the background without you doing anything which changes the file content.

Also, a database is a collection of files and not a single file. Taking two separate files from two different databases, puttig them together does not mean you will have a valid database… You will most likely have a corrupt database.

I want to repeat myself, this will NOT work, and it WILL corrupt your data.

If you need MySQL replication, just use native MySQL master-slave mode, or Galera Cluster for MySQL of you need a multi-master setup.

With master being set and the file only modified on one device in theory no conflicts should appear… But like @AudriusButkevicius said: syncing a database is not a good idea and even if you will not kill your database with master enabled, it is very likely that the synced database is corrupt and will never be in sync except the MySQL server is shut down and you sync then.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.