-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create separate metrics for BEGIN, COMMIT, and ROLLBACK statements in YSQL (#6486) #6729
Conversation
Hi, @VishnuK007. Looks like your commits don't use your proper email, so you aren't able to sign the CLA. You should set |
Thanks @jaki. I have made the suggested changes. Can you please take a look again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @VishnuK007. I'm not too familiar with prepare
. I don't see a problem with deferring it for later.
Notable issue is START TRANSACTION
is regarded as OtherStmt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaki - Could you please take another look? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait. Added one small comment. I'll run this through internal testing.
Co-authored-by: Jason Kim <git@jasonk.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. One questionable thing is that a COMMIT
on a transaction that went bad and actually rollbacks will register in metrics as a commit statement. That may or may not be desired, but I think it doesn't need to be decided in the scope of this PR.
BEGIN;
abc; -- syntax error
COMMIT; -- rollback
is this outdated now? Also, I don't think we support
|
Yes - agreed. The metric is measuring the user level operation initiated-- rather than what might happen underneath. For example, this may happen implicitly on a DML statement also if the txn conflicts with a higher priority txn. @jaki -- assuming/when your internal test runs also pass, can you squash & merge as well. |
I think I got it. Since "prepare" is mentioned by @kmuthukk in issue #6486, it probably means https://www.postgresql.org/docs/11/sql-prepare.html rather than https://www.postgresql.org/docs/11/sql-prepare-transaction.html. |
And internal testing looks fine. Merging. Leaving issue #6486 open because of |
This patch separates out the metrics for transaction begin/commit/rollback statements.
[Note: It doesn't break out PREPARE statements yet. The handling for that might require different logic, which I haven't been able to figure out yet. Might be best to separate the PREPARE handling into its own issue.]
Testing:
Sample output from page shown below: