# Writes are blocked when parallel transactions are running at PXC 8.0.27

**URL:** <https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958>\
**Category:** Percona XtraDB Cluster\
**Tags:** mysql, percona\
**Created:** [June 2, 2022, 11:34am UTC](https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958 "2022-06-02T11:34:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AneeshBabu](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aneeshbabu/32/1393_2.png) [@AneeshBabu](https://forums.percona.com/u/AneeshBabu)\
**Post date:** [June 2, 2022, 11:34am UTC](https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958/1 "2022-06-02T11:34:07Z")

</div>

Hi there ,  
I have a 3 node cluster -` PXC 8.0.27.`  
Transaction 1 :Iam inserting `1 CRORE` rows on table t1 at node1.  
Transaction 2 :Inserting `500 rows` on table t2 at same node1.

I see the `500 ROWS` are not inserted on table t2 at node1(blocked) until the `1 crore` rows are committed at all the nodes.  
1.Is this behavior expected …?  
2.Is this happening due to huge writes blocking the other transactions…?  
3.Is there any alternative to execute the transactions parallelly without blocking…?  
4.Is there any possibility of deadlocks since other transactions were blocked…?

```auto

Note : Both the transactions are executed parallelly.

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 2, 2022, 1:00pm UTC](https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958/2 "2022-06-02T13:00:31Z")

</div>

_I had to look up the word `crore` 😃 it means 10 Million._

Are you inserting the 1 crore rows as part of a single transaction? (ie: BEGIN; INSERT … 1 crore rows; COMMIT) Or are you running 1 crore individual INSERT statements? Can you please share more details of how you are running this simulation?

I would expect txn2 (500 rows) to finish before tx1 (10 million rows), thus replicating to other nodes before tx1 finishes.

3: Yes. You need to read up on the new streaming replication as part of PXC 8  
4: Not unless t1 and t2 share a Foreign Key

---

<div class="post-metadata">

**Author:** ![AneeshBabu](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aneeshbabu/32/1393_2.png) [@AneeshBabu](https://forums.percona.com/u/AneeshBabu)\
**Post date:** [June 2, 2022, 1:11pm UTC](https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958/3 "2022-06-02T13:11:16Z")

</div>

@matthewb  
yes iam inserting 1crore(10 million) transactions as part of single trasaction i.e  
BEGIN …

1 CRORE TRANSACTIONS …

END.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [June 2, 2022, 1:23pm UTC](https://forums.percona.com/t/writes-are-blocked-when-parallel-transactions-are-running-at-pxc-8-0-27/15958/4 "2022-06-02T13:23:21Z")

</div>

Like this?

```auto
txn1: BEGIN;
INSERT INTO table1 (id, name) VALUES (1, 'John');
INSERT INTO table1 (id, name) VALUES (2, 'John');
....
INSERT INTO table1 (id, name) VALUES (10000000, 'John');
COMMIT;

txn2: BEGIN;
INSERT INTO table2 (id, name) VALUES (1, 'Bob');
INSERT INTO table2 (id, name) VALUES (2, 'Bob');
....
INSERT INTO table2 (id, name) VALUES (500, 'Bob');
COMMIT;

```

You have 2 different sessions opened to MySQL? Open a 3rd session and ‘SHOW PROCESSLIST’ while both tx1 and tx2 are running, can you paste that output here?
