HomeMesosphereNo notifications. 4 unresolved issues.

Make Backup & Restore operations available via /v2/leader API
ClosedAll Users

Authored by aquamatthias on Apr 5 2017, 9:19 AM.

Details

Summary

A backup and restore operation can be triggered via the leader endpoint.
The intent is stored in zk and performed by the next leading master.
A RuntimeConfiguration with related repository is implemented to store configuration collected during runtime.
PersistentStoreBackup now always uses an URI to define the location for backup & restore.
The value provided via the cmd-line parameter is only used before a migration needs to be applied.

Test Plan

sbt test

Diff Detail

Repository
rMARATHON marathon
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aquamatthias created this revision.Apr 5 2017, 9:19 AM
jenkins requested changes to this revision.Apr 5 2017, 9:24 AM
This revision now requires changes to proceed.Apr 5 2017, 9:24 AM
jenkins accepted this revision.Apr 5 2017, 9:59 AM

(ノ◕ヮ◕)ノ*: It's Green :*ヽ(◕ヮ◕ヽ)

This revision is now accepted and ready to land.Apr 5 2017, 9:59 AM
aquamatthias added 1 JIRA issue(s): MARATHON-7044.Apr 6 2017, 5:27 PM

Will take a second pass later today. The raml generator takes in the files to generate from, so putting that type in src/main/raml would be super.

src/main/scala/mesosphere/util/state/RuntimeConfiguration.scala
8 ↗(On Diff #2524)

Can we make this in raml please? I was playing with using src/main/raml at one point so we could make a clear delineation that some stuff is internal types.

  • Describe RuntimeConfiguration in raml and use the generated type.
jasongilanfarr added inline comments.
src/main/scala/mesosphere/marathon/storage/store/ZkStoreSerialization.scala
190

minor, but there are a bunch of constants for UTF-8, e.g. StandardCharsets.UTF8

  • Add API documentation for the leader endpoint.
jenkins requested changes to this revision.Apr 12 2017, 3:26 PM
This revision now requires changes to proceed.Apr 12 2017, 3:26 PM
This revision is now accepted and ready to land.Apr 12 2017, 6:04 PM
aquamatthias added 1 JIRA issue(s): MARATHON-7046.Apr 13 2017, 11:43 AM

Can you add to the changelog and fix the "UTF-8" to use StandardCharsets.UTF_8? Other than that... I still accept.

jdef added a subscriber: jdef.Apr 14 2017, 3:45 PM

Docs please:

  • The documentation in the RAML files is pretty sparse w/ respect to the backup and restore feature when DELETE'ing leader.
  • Maybe a more elaborate explanation should be provided in docs/docs/...
jdef added a comment.Apr 14 2017, 3:46 PM

And I object to encoding credentials into the backup/restore URI -- we should allow admins to rely on IAM to avoid credential leakage.

jdef added inline comments.Apr 17 2017, 9:01 PM
src/main/scala/mesosphere/marathon/api/v2/LeaderResource.scala
48–54

this would probably be more clear (vs nested withValid and the validators outside the block, several lines away):

assumeValid {
  validate(block)(optional(UriIO.valid))
  validate(restore)(optional(UriIO.valid))
  result(...)
  ...
}
  • Describe RuntimeConfiguration in raml and use the generated type.
  • Add API documentation for the leader endpoint.
  • Incorporate feedback from review.
jenkins requested changes to this revision.Apr 19 2017, 6:50 PM
This revision now requires changes to proceed.Apr 19 2017, 6:50 PM
aquamatthias marked 2 inline comments as done.Apr 19 2017, 6:57 PM

@jdef
Documentation will be addressed with JIRA MARATHON-2040 Write a gh-pages site for backup & restore
Providing credentials as part of the url will be addressed with JIRA MARATHON-7235 S3 Credentials are too restrictive

This revision is now accepted and ready to land.Apr 19 2017, 7:47 PM
timcharper accepted this revision.Apr 20 2017, 4:11 AM
jenkins requested changes to this revision.Apr 20 2017, 8:40 AM
This revision now requires changes to proceed.Apr 20 2017, 8:40 AM
This revision is now accepted and ready to land.Apr 20 2017, 9:44 AM
jdef added inline comments.Apr 20 2017, 12:40 PM
docs/docs/rest-api/public/api/v2/leader.raml
27

I think we should do better here explaining how delete could trigger a re-election. We don't need to duplicate word for word what we have written somewhere else, but this is still too brief in my opinion.

jenkins requested changes to this revision.Apr 20 2017, 2:26 PM
This revision now requires changes to proceed.Apr 20 2017, 2:26 PM
jenkins requested changes to this revision.Apr 20 2017, 3:47 PM
This revision now requires changes to proceed.Apr 20 2017, 3:47 PM

Improve documentation on leader abdication.

jenkins requested changes to this revision.Apr 21 2017, 9:08 AM
This revision now requires changes to proceed.Apr 21 2017, 9:08 AM
jdef added a comment.Apr 21 2017, 2:32 PM

nice docs changes

docs/docs/rest-api/public/api/v2/types/pragma.raml
36

We need some kind of compile-time separation between public and internal types.

(a) I wonder if internal types should actually live in a separate package? Grouping them together in the same package as public API types is confusing and will lead to mistakes down the line.

(b) What rules can we implement in the RAML generator to enforce such separation? For example, does it make sense to implement a check that public types cannot refer to internal types? Check that API endpoints don't refer to any internal types?

At the very least please file a JIRA to track this concern

jenkins requested changes to this revision.Apr 24 2017, 6:10 PM
This revision now requires changes to proceed.Apr 24 2017, 6:10 PM
This revision is now accepted and ready to land.Apr 24 2017, 6:55 PM
This revision was automatically updated to reflect the committed changes.