forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: include SERIALIZATION_CONFLICT events in txn contention details
This commit introduces `SERIALIZATION_CONFLICT` contention event details to the txn insights details page. If a transaction insight failed with a 40001 error code, we will query `crdb_internal.transaction_contention_events` to see if there is any serialization conflict event containing the blocking txn exec id, fingerprint id and conflict location information. A section called `Failed Execution` will appear when this information is available with the following info: - blocking txn execution id - blocking txn finggerprint id - conflict location - db, table and index names Epic: none Closes: cockroachdb#111650 Release note (ui change): Txn insight details will show the following details when we have information on a txn execution with a 40001 error code and we have captured the conflicting txn meta (only available if the txn had not yet committed at the time of execution). A section called `Failed Execution` will appear when this information is available with the following info: - blocking txn execution id - blocking txn finggerprint id - conflict location - db, table and index names
- Loading branch information
Showing
8 changed files
with
160 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...i/workspaces/cluster-ui/src/insights/workloadInsightDetails/failedInsightDetailsPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import React from "react"; | ||
import { Col, Row } from "antd"; | ||
import { ContentionDetails } from "../types"; | ||
import { SummaryCard, SummaryCardItem } from "../../summaryCard"; | ||
import { Heading } from "@cockroachlabs/ui-components"; | ||
import classNames from "classnames/bind"; | ||
|
||
// TODO (xinhaoz) we should organize these common page details styles into its own file. | ||
import styles from "../../statementDetails/statementDetails.module.scss"; | ||
|
||
import "antd/lib/row/style"; | ||
import "antd/lib/col/style"; | ||
import { TransactionDetailsLink } from "../workloadInsights/util"; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
type Props = { | ||
conflictDetails: ContentionDetails; | ||
}; | ||
|
||
const FailedInsightDetailsPanelLabels = { | ||
SECTION_HEADER: "Failed Execution", | ||
CONFLICTING_TRANSACTION_HEADER: "Conflicting Transaction", | ||
CONFLICTING_TRANSACTION_EXEC_ID: "Transaction Execution", | ||
CONFLICTING_TRANSACTION_FINGERPRINT: "Transaction Fingerprint", | ||
CONFLICT_LOCATION_HEADER: "Conflict Location", | ||
DATABASE_NAME: "Database", | ||
TABLE_NAME: "Table", | ||
INDEX_NAME: "Index", | ||
}; | ||
|
||
export const FailedInsightDetailsPanel: React.FC<Props> = ({ | ||
conflictDetails, | ||
}) => { | ||
return ( | ||
<section | ||
className={cx("section", "section--container", "margin-bottom-large")} | ||
> | ||
<Row gutter={24}> | ||
<Col> | ||
<Heading type="h5"> | ||
{FailedInsightDetailsPanelLabels.SECTION_HEADER} | ||
</Heading> | ||
<Row gutter={24}> | ||
<Col className="gutter-row" span={12}> | ||
<SummaryCard className={cx("summary-card")}> | ||
<Heading type="h5"> | ||
{ | ||
FailedInsightDetailsPanelLabels.CONFLICTING_TRANSACTION_HEADER | ||
} | ||
</Heading> | ||
<SummaryCardItem | ||
label={ | ||
FailedInsightDetailsPanelLabels.CONFLICTING_TRANSACTION_EXEC_ID | ||
} | ||
value={conflictDetails.blockingExecutionID} | ||
/> | ||
<SummaryCardItem | ||
label={ | ||
FailedInsightDetailsPanelLabels.CONFLICTING_TRANSACTION_FINGERPRINT | ||
} | ||
value={TransactionDetailsLink( | ||
conflictDetails.blockingTxnFingerprintID, | ||
)} | ||
/> | ||
</SummaryCard> | ||
</Col> | ||
<Col className="gutter-row" span={12}> | ||
<SummaryCard className={cx("summary-card")}> | ||
<Heading type="h5"> | ||
{FailedInsightDetailsPanelLabels.CONFLICT_LOCATION_HEADER} | ||
</Heading> | ||
<SummaryCardItem | ||
label={FailedInsightDetailsPanelLabels.DATABASE_NAME} | ||
value={conflictDetails.databaseName} | ||
/> | ||
<SummaryCardItem | ||
label={FailedInsightDetailsPanelLabels.TABLE_NAME} | ||
value={conflictDetails.tableName} | ||
/> | ||
<SummaryCardItem | ||
label={FailedInsightDetailsPanelLabels.INDEX_NAME} | ||
value={conflictDetails.indexName} | ||
/> | ||
</SummaryCard> | ||
</Col> | ||
</Row> | ||
</Col> | ||
</Row> | ||
</section> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters