What is Global Transaction?

A global transaction is a transaction that involves more than one database server. HCL OneDB database servers support two types of global transactions: TP/XA with a transaction manager and two-phase commit.

HCL OneDB uses a two-phase commit protocol to ensure that distributed queries are uniformly committed or rolled back across multiple database servers.

Global Transaction needs to be terminated when your secondary server is stuck in Fast recovery mode and is not coming online. So, we need to locate and terminate global transactions. Sometimes, GT can be terminated gracefully or not, based on their FLAGs.

Scenario 1: Restarting Updateable secondary after a crash will get stuck in fast recovery mode until all open transactions are processed. Global transaction can be terminated gracefully.

In this scenario, your Updateable secondary was crashed due to several reasons and upon starting, it gets stuck in fast recovery mode.

The message below is in online.log of sds node:

12:13:04 Started processing open transactions on secondary during startup

The secondary will not be operational until all the global transactions were cleared.

The message above shows it is incomplete. The secondary will allow new sessions only if you see the completed string in the log.

20:10:05 Finished processing open transactions on secondary during startup.

Example

In the below example SDS was stuck in FR mode for almost 8 hours. We should look for the output of onstat –G from both primary and secondary. They should have different addresses in memory, but they can be identified by the “data” column. The Flag should have ‘H’ at the 3rd position, which means it was heuristically rolling back or rolled back.

We can zap them using onmode –H 0x61fbe988 and onmode -H 0x61fbecf0 on SDS node. Immediately you will see your SDS will be in operational mode.

Scenario 2 : Your secondary was stuck in FR mode and Global Transaction cannot be terminated gracefully.

We have two global transactions holding some locks. See onstat -G and onstat -x output below.

3rd flag shows

B- Begin Works

X- TP/XA prepared for commit

How can I get rid of them?

  • Transaction with flags value of ‘-LX-G’ do not have userthread information as in the example above.
  • These transactions are called orphaned transactions, and the user-thread has been dropped from the transaction.
  • If these transactions stop using the Logical Log, they may enter the Long Transaction state.

  • Log switching occurs naturally and causes a long transaction. This depends on the LTXHWM configuration variable setting, which by default is 70.
  • There are 10 Logical Logs, if a transaction is not completed during 7 log switches, a long transaction is usually triggered.

  • You can use onmode -l to manually switch the logical log and exceeds the LTXHWM limit, it will be processed as above. Generally, this does not affect instances or other transactions when processed as above.
  • Alternatively, you would temporarily lower LTXHWM using ‘onmode -wm LTXHWM=<low_value>’.

 

Comment wrap
Further Reading
article-img
Data Management | April 7, 2021
Data Security
The discipline of data security manifests through many capabilities that protect information at rest, in motion, and in use.   The average cost of a data breach in 2019 was calculated at $3.92 million which involved 25,575 accounts that year according to a report by the Ponemon Institute and IBM Security. High-profile companies such as Capital One, Evite, and Zynga experienced data breaches that exposed more than 100 million customer accounts each. Data breeches must be disclosed to customers, so they can be costly events that result in multi-million dollar lawsuits and settlements.   Many organizations realize two things, the value of data and the cost to protect data are increasing simultaneously. This makes protecting data with patches a very cost-prohibitive solution. More security layers and patches only add an equal cost to the overall situation. Instead, IT teams must design and implement the right data management strategy from the beginning and, select the right solutions.   To make matters worse, the median data volume that companies currently have under management – in both structured and unstructured formats – is now greater than 630TB, which is expected to exceed 820TB within two years. Data breeches must be disclosed to customers, so they can be costly events that result in multimillion-dollar lawsuits and settlements.   One best practice area for any data security strategy is database protection. This includes such things as monitoring database activity to detect unusual user activity, as well as conducting regular access reviews to identify old and unnecessary permissions. Both of which OneDB  permits through its OneDB  Explore front-end UX tool. It includes encrypting data, which OneDB does at various levels: column level; all or selected database storage units – dbspaces and subspaces; backup archives; client-server & server-server communication. And of course, enforcing the least amount of privilege possible to carry out a function policy is also prudent.    OneDB is a safe, cost-effective and efficient choice for data management. To learn more about how the HCL OneDB data platform will support your data security strategy, visit us at https://hcltechsw.com/products/onedb.   
article-img
Data Management | March 23, 2021
Becoming Data Driven
We are living in the data age. Enterprises today are generating data at an unprecedented pace and require the ability to store and utilize data like never before.   But where is the data going? Everywhere. For many enterprises, data sprawl is a real challenge. Thanks to modern technology advancements, the complexity created by data sprawl is compounded by an enterprise’s continuing need to manage legacy systems, deploy modern systems, and respond to changing business conditions in a timely fashion.   Enterprises are proactively undertaking strategic efforts to use data to make more informed business decisions, operational improvements, organizational changes, and enhancements to the customer experience.  Consider all the different data types that enterprises are analyzing (image below). The median data volume that companies currently have under management – in both structured and unstructured formats – is now greater than 630TB, with that number expected to exceed 820TB within two years.    Moving Past the Barriers     The systems, data types, and the analytical processes enterprises needed to execute against their data, are likely to evolve. While it would be difficult to predict what will be popular in the future, we do know that machine learning will see significant adoption over the next few years. Machine learning thirsts for data; multiple data types from numerical, text, images and more are used to train and build machine learning models.    For enterprises, it’s imperative to take the long view on data and data platform systems. It is rarely feasible to adopt and implement every new technology or system that comes along. It’s been proven repeatedly that polyglot persistence might be good for one-off workloads, but that model soon breaks down at scale. HCL’s cloud native, multi-model database, OneDB, is designed to overcome those limitations and scale to meet future data demands, while significantly lowering TCO.   Why Choose HCL OneDB   OneDB provides a rich multi-model data platform for your...
article-img
Cloud Native, Data Management | November 19, 2020
Powering Cloud-Native Apps with OneDB
What is your company's strategy to managing the growing demands of continuous data and support cloud-native app development at today's rate? For many leaders they seek to modernize their data platform strategy to meet these challenges.  OneDB is a feature-rich and equally able to serve as the foundation for cloud solutions, embedded applications, and IoT or edge solutions. Whether you're ready to build brand cloud-native apps, rehost or re-platform applications to take advantage of the destination platform, HCL OneDB will set you at ease with it's multi-model, cloud-native capabilities, one step at a time.  HCL OneDB is well known for its reliability, performance, and simplicity. Whether deployed on premise, public cloud, or private cloud, clients will be able to gain further advantages.  Many of the unique advantages include: Always-on Transactions - Keep data available at all times, including zero downtime for maintenance and unplanned outages.  Increased Productivity - Stable multi-model data management allows you to focus and quickly deliver the right type of data for the business solutions you need.  Detecting Patterns - HCL OneDB is optimized to find anomalies and deviations for predictive analytics in Spatio-temporal data. Ease of Use - OneDB Explore, our modern graphical administration and monitoring tool for HCL OneDB gives you the ability to monitor what is critical, and take action on what is necessary to keep your business running smoothly.  To learn about OneDB's key capabilities visit our website or download our datasheet here. 
Close