Skip to content

Commit

Permalink
feat: add minimum time to unresolved transaction request
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Sep 16, 2024
1 parent 8b57e7c commit 22e731a
Show file tree
Hide file tree
Showing 32 changed files with 2,662 additions and 2,396 deletions.
9 changes: 8 additions & 1 deletion go/cmd/vtctldclient/command/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ var (
DisableFlagsInUseLine: true,
}

unresolvedTransactionsOptions = struct {
AbandonAge int64 // in seconds
}{}

// GetUnresolvedTransactions makes an GetUnresolvedTransactions gRPC call to a vtctld.
GetUnresolvedTransactions = &cobra.Command{
Use: "list <keyspace>",
Use: "list <keyspace> --abandon-age <abandon_time_seconds>",
Short: "Retrieves unresolved transactions for the given keyspace.",
Aliases: []string{"List"},
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -76,6 +80,7 @@ func commandGetUnresolvedTransactions(cmd *cobra.Command, args []string) error {
resp, err := client.GetUnresolvedTransactions(commandCtx,
&vtctldatapb.GetUnresolvedTransactionsRequest{
Keyspace: keyspace,
MinAge: unresolvedTransactionsOptions.AbandonAge,
})
if err != nil {
return err
Expand Down Expand Up @@ -127,6 +132,8 @@ func commandConcludeTransaction(cmd *cobra.Command, args []string) error {
}

func init() {
DistributedTransaction.Flags().Int64VarP(&unresolvedTransactionsOptions.AbandonAge, "abandon-age", "a", 0, "Returns unresolved transactions list which are older than the specified age in seconds.")

DistributedTransaction.AddCommand(GetUnresolvedTransactions)
DistributedTransaction.AddCommand(ConcludeTransaction)

Expand Down
886 changes: 448 additions & 438 deletions go/vt/proto/query/query.pb.go

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions go/vt/proto/query/query_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,489 changes: 750 additions & 739 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 22e731a

Please sign in to comment.