Code Monkey home page Code Monkey logo

Comments (7)

laurenz avatar laurenz commented on August 18, 2024

This is the same problem as #12.

As mentioned there, pgreplay can only replay the statements in the order they appear in the log, but it cannot guarantee that they will be processed in that order.

In addition to the workarounds shown there, you could also set lock_timeout to a low value during replay. That will prevent hanging indefinitely long, but it will cause delays, and some statements won't be executed. Still, it might be good enough, if the deadlocks happen only rarely.

from pgreplay.

TimGustafson avatar TimGustafson commented on August 18, 2024

Unfortunately, the deadlocks are very common during replay (but not on the source server) with this workload, and we're talking about several thousand transactions per second. Another possibility is to ignore transaction statements when replaying the queries, which may lead to data integrity issues on the target database (as would the lock_timeout option) but in this workload rollbacks are practically non-existent, so it would be a much better test.

from pgreplay.

laurenz avatar laurenz commented on August 18, 2024

I see.
There is no option to exclude certain commands, but you could grep all BEGIN and COMMIT statements from the log file before replaying it.
I was under the impression that you are not talking about database deadlocks (which are automatically resolved after a second), but about hangs during replay that are never resolved. Which one is it?
Doing away with transactions would only reduce (not totally avoid!) the first kind of deadlocks, but not ones in pgreplay.

from pgreplay.

TimGustafson avatar TimGustafson commented on August 18, 2024

Good point; excluding those via grep should work.

I am talking about database deadlocks. They do not appear to be resolved after a second. If I don't kill the query in PostgreSQL, it hangs indefinitely. From what I can tell, the locks are caused by update queries that contain select clauses in them. I'll give the grep suggestion a try and let you know what I find.

from pgreplay.

laurenz avatar laurenz commented on August 18, 2024

That's not database deadlocks then.
They are live locks in the database, but the session that is not hanging is waiting (in pgreplay) for the hanging statement to complete.
Perhaps removing transactions will help, but it is not certain.

from pgreplay.

laurenz avatar laurenz commented on August 18, 2024

Did it help?

from pgreplay.

TimGustafson avatar TimGustafson commented on August 18, 2024

It's on my list for next week; sorry for the delay.

from pgreplay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.