Skip to content
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

configuration backup/restore in online mode #14

Closed
Ladicek opened this issue Nov 5, 2015 · 21 comments
Closed

configuration backup/restore in online mode #14

Ladicek opened this issue Nov 5, 2015 · 21 comments
Assignees
Milestone

Comments

@Ladicek
Copy link
Contributor

Ladicek commented Nov 5, 2015

The ConfigurationFileBackup set of offline commands facilitate taking a backup of the server configuration and later restoring it. It would be very useful to have the same possibility in the online mode, e.g. using the existing snapshot function. This would most probably require some kind of support from the server; I didn't file a feature request yet, so I'm filing this issue so that I don't forget :-)

@Ladicek
Copy link
Contributor Author

Ladicek commented Jun 29, 2016

Turns out that a WFCORE issue for this already exists: https://issues.jboss.org/browse/WFCORE-351

@Ladicek
Copy link
Contributor Author

Ladicek commented Jun 30, 2016

There's also https://issues.jboss.org/browse/WFCORE-1052 which has been fixed for WildFly Core 3, i.e. something like WildFly 11 or so. I believe that WFCORE-351 is actually fixed by WFCORE-1052, so backup/restore will be easily possible. Not sure if it still makes sense to fix #123; probably yes, but it's debatable.

olukas pushed a commit to olukas/creaper that referenced this issue Sep 23, 2016
@mchoma
Copy link
Collaborator

mchoma commented Oct 14, 2016

@Ladicek, what is the state of this super-useful feature? Waiting for wildfly 11 to be released?

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 14, 2016

@mchoma Waiting for at least WildFly 11.0.0.Alpha1. Currently, there's no release that contains the feature, AFAIK.

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 14, 2016

Hmm, I see there actually are releases of WildFly Core 3, so working on this would be possible... @mchoma If you feel like doing it, feel free :-)

@mchoma
Copy link
Collaborator

mchoma commented Oct 14, 2016

@Ladicek, yes I can look at it. We will implement it somehow for our needs, anyway.

@mchoma
Copy link
Collaborator

mchoma commented Oct 25, 2016

@Ladicek to use this feature you need

  1. [standalone@localhost:9990 /] :take-snapshot { "outcome" => "success", "result" => "/home/mchoma/workspace/git-repositories/tests-ldap-kerberos-eap7/tests/target/dist/jboss-eap/standalone/configuration/standalone_xml_history/snapshot/20161025-132754558standalone.xml" }
  2. [standalone@localhost:9990 /] reload --server-config=20161025-132754558standalone.xml

However, not sure how that should map to creaper concept. For 2. should analogy to ReloadToOrigin, something like ReloadToSnapshot be created. For 1. I did not find any implementation of other :

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 25, 2016

See the ConfigurationFileBackup command -- I'd expect this implementation to have a very similar API to that.

ReloadToOriginal is an exception, not a rule that should be followed.

@mchoma
Copy link
Collaborator

mchoma commented Nov 1, 2016

Creating Creaper tests I get

org.wildfly.extras.creaper.core.CommandFailedException: org.wildfly.extras.creaper.core.online.CliException: org.jboss.as.cli.CommandFormatException: Unrecognized arguments: [--server-config]
    at org.jboss.as.cli.handlers.CommandHandlerWithArguments.recognizeArguments(CommandHandlerWithArguments.java:103)
    at org.jboss.as.cli.handlers.BaseOperationCommand.buildRequest(BaseOperationCommand.java:251)
    at org.jboss.as.cli.impl.CommandContextImpl.buildRequest(CommandContextImpl.java:1395)
    at org.jboss.as.cli.impl.CommandContextImpl.buildRequest(CommandContextImpl.java:1360)
    at org.jboss.as.cli.impl.WorkaroundForWFCORE526_CommandContextImpl.buildRequest(WorkaroundForWFCORE526_CommandContextImpl.java:1)
    at org.wildfly.extras.creaper.core.online.OnlineManagementClientImpl.execute(OnlineManagementClientImpl.java:173)
    at org.wildfly.extras.creaper.core.online.AutomaticErrorHandlingForCommands.execute(AutomaticErrorHandlingForCommands.java:91)
    at org.wildfly.extras.creaper.commands.foundation.online.SnapshotBackup$2.apply(SnapshotBackup.java:64)
    at org.wildfly.extras.creaper.core.online.OnlineManagementClientImpl.apply(OnlineManagementClientImpl.java:136)
    at org.wildfly.extras.creaper.core.online.OnlineManagementClientImpl.apply(OnlineManagementClientImpl.java:125)
    at org.wildfly.extras.creaper.commands.foundation.online.SnapshotBackupTest.restoreTwice(SnapshotBackupTest.java:52)

I guess it is caused by creaper dependency on 2.0.10.Final of wildfly-core , but to make this feature work creaper have to depend on 3.0.x . How to handle properly this situation? Wait?

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 1, 2016

Add a testsuite profile wildfly11 (with a comment that while WildFly 11 isn't out yet, WildFly Core 3 is and it's likely the base of WildFly 11) and limit the test to this profile. That would be my first suggestion.

@mchoma
Copy link
Collaborator

mchoma commented Nov 1, 2016

Somehow managed to work, but TS behaves unstable - connecting to wildfly takes some time. Had to set connectionTimeout(5000). But keep getting from arquillian on shutdown "Could not connect to http-remoting://127.0.0.1:9990. The connection failed"

mchoma@4c77f7a

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 1, 2016

I think this occ.client.execute("reload --server-config=" + SnapshotBackup.this.snapshotName); is what's wrong. This needs to be implemented using Administration.reload.

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 2, 2016

To expand on "this needs to be implemented using Administration.reload": that doesn't necessarily mean that you have to call Administration.reload, just that you need to use the underlying mechanisms. It might very well be that the best course of action would be providing ReloadToSnapshot, similarly to ReloadToOriginal, and use ReloadToSnapshot as a low-level primitive to implement SnapshotBackup.restore.

@mchoma
Copy link
Collaborator

mchoma commented Nov 11, 2016

Commit: mchoma@b83b2ea

Did some naive reimplementation of restore part of SnapshotBackup, but didnt help. I workarounded test failures with Thread.sleep - let server to reload properly. Test now passed. I doesn't mean that as solution, just pointing where problem is.

Thinking about proper ReloadToSnapshot implementation, compare to ReloadToOriginal parameter snapshotName need to bee pass into.

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 11, 2016

Moving from occ.client.execute("reload --server-config=" ...) to Operations.invoke can't possibly help. As I said, you need to use the mechanisms under Administration.reload -- the implementation of waiting for reload to finish is already there.

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 11, 2016

I implemented ReloadToSnapshot over here: https://github.com/Ladicek/creaper/commits/reload-to-snapshot I will create a PR with this later, once you show that it works.

@mchoma
Copy link
Collaborator

mchoma commented Nov 11, 2016

Works like a charm for me.

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 11, 2016

Good! :-)

@Ladicek
Copy link
Contributor Author

Ladicek commented Nov 11, 2016

I've merged the ReloadToSnapshot change: #144 Please rebase on that.

@Ladicek Ladicek added this to the 1.6.0 milestone Nov 11, 2016
@mchoma
Copy link
Collaborator

mchoma commented Feb 1, 2017

It is already merged #14 . @Ladicek, Feel free to close this issue.

@Ladicek
Copy link
Contributor Author

Ladicek commented Feb 2, 2017

Ah, true! Thanks for reminding me.

@Ladicek Ladicek closed this as completed Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants