Skip to content

Conversation

@milanbrkic-ms
Copy link
Member

Description

This PR introduces 4 new command that are going to be used for starting, stopping, completing and getting status of Log Replay service on managed database.

Testing Guide

az sql midb log-replay start
az sql midb log-replay show
az sql midb log-replay stop
az sql midb log-replay complete

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 16, 2020

SQL

@yonzhan yonzhan added this to the S176 milestone Sep 16, 2020
@milanbrkic-ms
Copy link
Member Author

Hi @Juliehzl, I fixed all issues in this PR. Can you please take a look?
ps: The automation full test are failing for key vault tests which are not part of my change at all.

FailoverPolicyType,
SqlServerMinimalTlsVersionType,
SqlManagedInstanceMinimalTlsVersionType,
AuthenticationType
Copy link
Member Author

Choose a reason for hiding this comment

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

AuthenticationType is removed from SDK. This shouldn't be part of my change but I was getting build errors. I think I didn't broke anything 🤞

Applies requested parameters to a db resource instance for a DB update.
'''
# Verify edition
if instance.sku.tier.lower() == DatabaseEdition.data_warehouse.value.lower(): # pylint: disable=no-member
Copy link
Member Author

Choose a reason for hiding this comment

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

DatabaseEdition was removed from SDK also. Same thing as above

@bim-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

client_factory=get_sql_managed_databases_operations) as g:
g.custom_command('start', 'managed_db_log_replay_start', supports_no_wait=True)
g.command('stop', 'delete', confirmation=True, supports_no_wait=True)
g.command('complete', 'complete_restore')
Copy link
Contributor

Choose a reason for hiding this comment

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

please add wait command here

Copy link
Member Author

Choose a reason for hiding this comment

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

I added, but can you tell what is the use case for wait command? Why am I adding it (there must be some rule that I am not aware of ) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

because you support no wait for some commands, e.g. start, stop, if users use --no-wait in your command, the command will not wait any more. But if i want to query command status, i have to use wait command

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh okay I get it now. Thanks

@milanbrkic-ms
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 15168 in repo Azure/azure-cli

@Juliehzl
Copy link
Contributor

@MilanBrkicFON please also take a look for CI failures

@milanbrkic-ms
Copy link
Member Author

@Juliehzl They are not mine test.. mostly key vault

@Juliehzl
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Juliehzl
Copy link
Contributor

please revert this change a78f79a.

or you can rebase dev branch and makesure keyvault package version == 7.0.0.b3

sleep(60)

# Cancel log replay service
self.cmd('sql midb log-replay stop -g {resource_group} --mi {managed_instance_name} -n {managed_database_name1} --yes',
Copy link
Contributor

Choose a reason for hiding this comment

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

could you also add test for wait command?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't add wait command in test because the provisioning of MI takes too much time.. I did test it manual and it works as expected.
Hope this is ok

@Juliehzl Juliehzl merged commit fb7d72c into Azure:dev Sep 29, 2020
Juliehzl pushed a commit to Juliehzl/azure-cli that referenced this pull request Sep 30, 2020
…ed database (Azure#15168)

* {Docs} Remove stale reference in README to closed issue about extensions (Azure#12771)

* midb log-replay commands

* fixed tests and styles

* Fixing alias for some params

* making things right

* Typos and wait command

* add wait command in help file

* reverting changes that are not part of my change

* setup file changed by mistake

* removed group create

* fix key vault issues

* Added examples for log-replay wait command and fixed typos

Co-authored-by: Daniel Miller <[email protected]>
Co-authored-by: Azure CLI Team <[email protected]>
Co-authored-by: Milan Brkic <[email protected]>
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

Successfully merging this pull request may close these issues.

7 participants