DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • MySQL Multi-Source Replication
  • SQL Commands: A Brief Guide
  • Advantages and Disadvantages of Data Replication in Distributed Databases
  • What Are SpeedUp and ScaleUp in DBMS?

Trending

  • How To Validate Archives and Identify Invalid Documents in Java
  • Top Mistakes Made by Product Owners in Agile Projects
  • Best Plugins For JetBrains IDEs
  • Architecting a Completely Private VPC Network and Automating the Deployment
  1. DZone
  2. Data Engineering
  3. Databases
  4. What is innodb_support_xa?

What is innodb_support_xa?

Peter Zaitsev user avatar by
Peter Zaitsev
·
Mar. 03, 11 · News
Like (0)
Save
Tweet
Share
4.33K Views

Join the DZone community and get the full member experience.

Join For Free

This is a guest post by Baron Schwartz

A common misunderstanding about innodb_support_xa is that it enables user-initiated XA transactions, that is, transactions that are prepared and then committed on multiple systems, with an external transaction coordinator. This is actually not precisely what this option is for. It enables two-phase commit in InnoDB (prepare, then commit). This is necessary not only for user-initiated XA, but also for internal XA coordination between the InnoDB transaction logs and the MySQL binary logs, to ensure that they are consistent. Consistent is an important word with a special meaning.

We have done some benchmarking and performance research on this option in the past (see also: post 1, post 2). This was motivated by the severe performance hit that occurred when the commit process was changed to an internal XA implementation. This did two things: it disabled group commit, and it added an extra fsync per commit. The extra fsync is required because during the internal ‘prepare’ stage, the transaction can’t be considered prepared (and thus guaranteed to be recoverable) until it is synced to durable storage. The final fsync marks the transaction as committed, not just prepared. The extra fsync can be avoided by disabling the option. (Group commit can’t be re-enabled unless the binary log is also disabled.)

The prepare-then-commit process does two important things: it ensures that the binary log and the engine’s transaction log agree on which transactions are committed; and it ensures that they agree on the order in which the transactions were committed. The first is important for crash recovery, and the second is important for replication.

However, it is not as simple as “if you want higher performance, disable innodb_support_xa.” Our past blog posts might have been too shallow in their discussion on this point. You can disable InnoDB two-phase commit if you wish, but you need to weigh the risk of out-of-sync data on replicas (and after point-in-time recovery) when you do that.

Unfortunately, the manual isn’t that helpful in this instance — it doesn’t clear things up very well:

When the variable is enabled (the default), InnoDB support for two-phase commit in XA transactions is enabled, which causes an extra disk flush for transaction preparation. If you do not wish to use XA transactions, you can disable this variable to reduce the number of disk flushes and get better InnoDB performance. Having innodb_support_xa enabled on a replication master—or on any MySQL server where binary logging is in use—ensures that the binary log does not get out of sync compared to the table data.

That sort of touches on both internal and external XA transactions, but doesn’t distinguish between them. Hopefully this post will help clarify the difference, and help people make good decisions about the setting. Thanks to Kristian Nielsen for review and feedback.

Commit (data management) POST (HTTP) InnoDB Transaction log Replication (computing) Data (computing) MySQL Clear (Unix) Sort (Unix)

Published at DZone with permission of Peter Zaitsev, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • MySQL Multi-Source Replication
  • SQL Commands: A Brief Guide
  • Advantages and Disadvantages of Data Replication in Distributed Databases
  • What Are SpeedUp and ScaleUp in DBMS?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: