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

fix(deadline): lock down DocDC engine to version 3.6.0 #230

Merged
merged 4 commits into from
Nov 20, 2020

Conversation

ddneilson
Copy link
Contributor

@ddneilson ddneilson commented Nov 12, 2020

Fixes: #229

Testing

Did a quick deploy of the Deadline Repository & RCS. Verified it deployed successfully, and the DocDB engine version was correct. Also changed the engine version to 4.0.0 and did the same to verify that it changed there too.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Copy link
Contributor

@jusiskin jusiskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some guidance to the relevant TSDoc entries? I'm thinking good places might be:

  • the Repository construct
  • the DatabaseConnection.forDocDB method.

I was also hopeful we could perform a pre-flight run-time validation, but unfortunately it looks like the engine version is not available as a DatabaseCluster attribute.

@@ -490,6 +490,7 @@ export class Repository extends Construct implements IRepository {
const instances = props.documentDbInstanceCount ?? Repository.DEFAULT_NUM_DOCDB_INSTANCES;
const dbCluster = new DatabaseCluster(this, 'DocumentDatabase', {
masterUser: {username: 'DocDBUser'},
engineVersion: '3.6.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things:

  1. This is good for the case where props.database is not supplied, but is it possible to add validation that the engine is correct for the code path where a caller specifies their own cluster and fail-fast?
  2. Can we add a test for this new behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea. I'll see what I can cobble together.

@jusiskin jusiskin added the contribution/core This is a PR that came from AWS. label Nov 17, 2020
Comment on lines 276 to 279
if (cluster.engineVersion === '3.6.0') {
return true;
}
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm just thinking in the event that DocDB issues a patch version for 3.6. Just in case, should we relax the final version component here? So:

return cluster.engineVersion.startsWith('3.6.');

It looks like RDS has patch engine versions for other DB types:

$ aws docdb describe-db-engine-versions --engine mariadb --engine-version 10.0.17
{
    "DBEngineVersions": [
        {
            "Engine": "mariadb",
            "EngineVersion": "10.0.17",
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No harm in doing that, though the DocDB service team will never have any 3.6 value other than 3.6.0 and similarly, no 4.0 other than 4.0.0. They specifically don't do patch versions.

@@ -288,6 +288,7 @@ export interface RepositoryProps {

/**
* Specify the database where the deadline schema needs to be initialized.
* Note that Deadline supports only databases that are compatible with MongoDB 3.6.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I had also suggested adding something to the TSDoc string of DatabaseConnection.forDocDB too. Perhaps even DocDBConnectionOptions.database. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. Sure. I can add something there...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for DocDBConnectionOptions.database wasn't updated, do we need that too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added those too in latest rev.

@@ -163,6 +165,10 @@ class DocDBDatabaseConnection extends DatabaseConnection {
constructor(private readonly props: DocDBConnectionOptions) {
super();

if (!this.isCompatibleDocDBVersion()) {
Annotations.of(props.database).addError('engineVersion must be 3.6.0 to be compatible with Deadline');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as below. Should we relax this message to 3.6.x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still says 3.6.0 but our other messaging and the version check all use 3.6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I discussed this with Josh offline. DocumentDB doesn't do patch-level versions. It will always be 3.6.0

jusiskin
jusiskin previously approved these changes Nov 18, 2020
Copy link
Contributor

@jusiskin jusiskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approved!

Copy link
Contributor

@jusiskin jusiskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thanks @ddneilson

@jusiskin jusiskin changed the title fix(deadline): Lock down docdb engine to version 3.6.0 fix(deadline): lock down DocDC engine to version 3.6.0 Nov 20, 2020
@jusiskin jusiskin merged commit 2f46944 into aws:mainline Nov 20, 2020
@ddneilson ddneilson deleted the lock_docdb_version branch March 17, 2021 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DocDB version is not locked to v3.6 for Deadline
3 participants