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(cdb): [116078583]Fixed the problem of clienttoken duplication caus… #2549

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2549.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_mysql_instance: Fixed the problem of clienttoken duplication caused by creation retry.
```
4 changes: 4 additions & 0 deletions tencentcloud/services/cdb/resource_tc_mysql_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ func mysqlCreateInstancePayByMonth(ctx context.Context, d *schema.ResourceData,
var response *cdb.CreateDBInstanceResponse
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
// shadowed response will not pass to outside
clientToken := helper.BuildToken()
request.ClientToken = &clientToken
r, inErr := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseMysqlClient().CreateDBInstance(request)
if inErr != nil {
log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n",
Expand Down Expand Up @@ -621,6 +623,8 @@ func mysqlCreateInstancePayByUse(ctx context.Context, d *schema.ResourceData, me
var response *cdb.CreateDBInstanceHourResponse
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
// shadowed response will not pass to outside
clientToken := helper.BuildToken()
request.ClientToken = &clientToken
r, inErr := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseMysqlClient().CreateDBInstanceHour(request)
if inErr != nil {
return tccommon.RetryError(inErr)
Expand Down
Loading