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

storage: address TODO in TestPushTxnHeartbeatTimeout #39161

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
15 changes: 6 additions & 9 deletions pkg/storage/replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5159,15 +5159,12 @@ func TestPushTxnHeartbeatTimeout(t *testing.T) {
t.Fatalf("%d: %s", i, pErr)
}
case roachpb.STAGING:
// TODO(nvanbenschoten): Avoid writing directly to the engine once
// there's a way to create a STAGING transaction record.
txnKey := keys.TransactionKey(pushee.Key, pushee.ID)
txnRecord := pushee.AsRecord()
txnRecord.Status = roachpb.STAGING
if err := engine.MVCCPutProto(
context.Background(), tc.repl.store.Engine(), nil, txnKey, hlc.Timestamp{}, nil, &txnRecord,
); err != nil {
t.Fatal(err)
et, etH := endTxnArgs(pushee, true)
et.InFlightWrites = []roachpb.SequencedWrite{
{Key: key, Sequence: 1},
}
if _, pErr := client.SendWrappedWith(context.Background(), tc.Sender(), etH, &et); pErr != nil {
t.Fatalf("%d: %s", i, pErr)
}
default:
t.Fatalf("unexpected status: %v", test.status)
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/txn_recovery_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func TestTxnRecoveryFromStaging(t *testing.T) {
// state. Include both writes as the EndTransaction's in-flight writes.
et, etH := endTxnArgs(txn, true)
et.InFlightWrites = []roachpb.SequencedWrite{
{Key: keyA, Sequence: 0},
{Key: keyB, Sequence: 1},
{Key: keyA, Sequence: 1},
{Key: keyB, Sequence: 2},
}
etReply, pErr := client.SendWrappedWith(ctx, store.TestSender(), etH, &et)
if pErr != nil {
Expand Down