question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues starting transactions

See original GitHub issue

I am using a Pulsar 2.8.0 container starting in standalone mode. I am following this page to enable transactions https://pulsar.apache.org/docs/en/next/txn-use/ (specifically, setting transactionCoordinatorEnabled to true and running bin/pulsar initialize-transaction-coordinator-metadata -cs 127.0.0.1:2181 -c standalone).

When I try to start a transaction with version 2.8.1, I get an exception Transaction manager is not started or not enabled with stack trace:

   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse@131.Invoke(Unit unitVar0)
   at FSharp.Control.Tasks.TaskBuilder.tryWith[a](FSharpFunc`2 step, FSharpFunc`2 catch)
--- End of stack trace from previous location ---
   at FSharp.Control.Tasks.TaskBuilder.bindTaskConfigureFalse@131.Invoke(Unit unitVar0)
   at FSharp.Control.Tasks.TaskBuilder.StepStateMachine`1.nextAwaitable()
--- End of stack trace from previous location ---
  ...

Here is a quick repro:

private async static Task TestPulsarContainer(string connectionString)
{
	string topicName = "testTopic";
	PulsarClient pulsarClient = await new PulsarClientBuilder().EnableTransaction(true).ServiceUrl(connectionString).BuildAsync();
	IProducer<byte[]> producer = await pulsarClient.NewProducer().Topic(topicName).CreateAsync();
	IConsumer<byte[]> consumer = await pulsarClient.NewConsumer().Topic(topicName).SubscriptionName("testSubscription").SubscribeAsync();

	string testMessage = "Test message";
	MessageId messageId = await producer.SendAsync(Encoding.UTF8.GetBytes(testMessage));
	Message<byte[]> message = await consumer.ReceiveAsync();

	// Exception occurs when creating the transaction.
	Transaction transaction = await pulsarClient.NewTransaction().BuildAsync();
	MessageBuilder<byte[]> messageBuilder = producer.NewMessage(Encoding.UTF8.GetBytes("test"), txn: transaction);
	await producer.SendAsync(messageBuilder);
	await consumer.AcknowledgeAsync(message.MessageId, transaction);
	await transaction.Commit();
}

Any ideas on if this is a config issue or a client issue?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tgrieger-sfcommented, Sep 15, 2021

I got the transactions working. Instead of updating the values and running the transaction initialization command, I run this script at startup:

#!/bin/sh
sed -i 's/transactionCoordinatorEnabled=false/transactionCoordinatorEnabled=true/g' /pulsar/conf/broker.conf
sed -i 's/transactionCoordinatorEnabled=false/transactionCoordinatorEnabled=true/g' /pulsar/conf/standalone.conf
/pulsar/bin/pulsar standalone

Thanks for looking into it, @Lanayx

0reactions
tgrieger-sfcommented, Sep 15, 2021

There are no messages happening in the output of the container (if that’s the broker’s log) when that exception occurs. There is output when the topics and subscriptions are created.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Transactions
Troubleshooting Transactions. This section offers information to help you resolve problems in working with transactions. If performance monitoring is not ...
Read more >
How to fix beginning balance issues when reconciling in ...
This means something changed about your cleared transactions ... How to fix beginning balance issues when reconciling in QuickBooks Online.
Read more >
15 Understand Issue Transactions
15.1 When Do You Issue Inventory? You do not have to generate an issues transactions at the same time that inventory is physically...
Read more >
What are the problems of using transactions in a database?
One issue with transactions is that it's possible (unlikely, but possible) to get deadlocks in the DB.
Read more >
Fix issues when you're reconciling in QuickBooks Desktop
Fix issues when you're reconciling in QuickBooks Desktop · Step 1: Review your opening and beginning balances · Step 2: Look for changed,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found