From 457abb11be1bb45222dc317bc1c097b51c59075a Mon Sep 17 00:00:00 2001 From: reshke Date: Tue, 2 Apr 2024 16:31:54 +0500 Subject: [PATCH 1/2] Update etcdqdb.go --- qdb/etcdqdb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/qdb/etcdqdb.go b/qdb/etcdqdb.go index e28aa4323..2195b39d9 100644 --- a/qdb/etcdqdb.go +++ b/qdb/etcdqdb.go @@ -521,6 +521,7 @@ func (q *EtcdQDB) TryCoordinatorLock(ctx context.Context) error { } if !stat.Succeeded { + _ = q.cli.Lease.Close() return spqrerror.New(spqrerror.SPQR_UNEXPECTED, "qdb is already in use") } From 3fe56878f151510a9f0be3d076112d23a97683b6 Mon Sep 17 00:00:00 2001 From: reshke Date: Tue, 2 Apr 2024 16:50:00 +0500 Subject: [PATCH 2/2] Update etcdqdb.go --- qdb/etcdqdb.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qdb/etcdqdb.go b/qdb/etcdqdb.go index 2195b39d9..2cbb3c787 100644 --- a/qdb/etcdqdb.go +++ b/qdb/etcdqdb.go @@ -521,7 +521,10 @@ func (q *EtcdQDB) TryCoordinatorLock(ctx context.Context) error { } if !stat.Succeeded { - _ = q.cli.Lease.Close() + _, err := q.cli.Lease.Revoke(ctx, leaseGrantResp.ID) + if err != nil { + return err + } return spqrerror.New(spqrerror.SPQR_UNEXPECTED, "qdb is already in use") }