tchlyah / couchmove

Java data migration tool for Couchbase
Apache License 2.0
39 stars 14 forks source link

[Question] How failures are handled by couchmove? #7

Open VeronikaVakadinova opened 4 years ago

VeronikaVakadinova commented 4 years ago

Hello all,

I am at the point of research methods and tools for migrating couchbase documents in an elegant manner. I saw no description inside the provided wiki page of how failures are handled in here? Is there a row back to the previous state of the DB?

As well, are there any limitations that could be faced - like a number of records manipulated or something else?

And lastly, is there a way to pass arguments to the statements that should be executed? If they are coming from somewhere else and an application should commit them inside the DB?

Thanks in advance.

tchlyah commented 4 years ago

Hello @VeronikaVakadinova, sorry for my late response.

I saw no description inside the provided wiki page of how failures are handled in here?

If a changeLog is in failure, it'll mark it as failed, throw an exception and stop the execution. There is no retry mechanism implemented, if you want one, you need to implemented yourself by wrapping couchmove.migrate() in a try {} catch block.

You can either retry the execution, or manually fix the failing changeLog. When relaunching the migration, Couchmove will retry the failed changeLog even if its checksum was modified, if it passes then it'll continue to next ones.

Is there a row back to the previous state of the DB? No, there is no rollback implemented, this can be implemented in two ways:

  • Couchbase new transaction feature
  • Manually adding rollback files begining with R instead of V, with the same version of ChangeLog to rollback.

And lastly, is there a way to pass arguments to the statements that should be executed? If they are coming from somewhere else and an application should commit them inside the DB?

For now, the only argument you can pass is the bucket param as you can see in this example: V0__create_index.n1ql

Any help implementing these features is welcome