Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide ability for engine to forcely make rollback for each TX that stays uncommitted more than some limit of time [CORE4238] #4562

Closed
firebird-automations opened this issue Sep 25, 2013 · 17 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Is related to CORE985
Is replaced by CORE5488

Votes: 1

If TX has been opened in any mode tha is NOT { read_committed | read_only } then its very easy to force database to accumulate in it huge amount of versions of updated / deleted records: it's sufficient just avoid commit/rollback such TX. This leads to "heavy work" for GC and almost always decrease application performance (all DML except insertions).

It will be useful if DBA could assign (in database.conf or firebird.conf) maximum allowed timeout for ANY transactions that have been started in NOT ( read_committed | read_only ) mode - even if they started by SYSDBA or db owner. Such TXs should be forcelly committed (if no changes occured) or rollbacked.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

summary: Provide ability for engine to forcely make DISCONNECT for each client that starts TX and keep it uncommitted more than some limit of time => Provide ability for engine to forcely make rollback for each TX that stays uncommitted more than some limit of time

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

That would have a potential impact on gbak (or any equivalent process that a developer might need to create). It opens standard DB connection/transactions to then extract the data from the database. This suggestion would have the effect of killing such a process.

It seems that this issue is trying to solve application issues at the database level, that is not correct.

Further, if this were an issue for a developer, then they are free to build an application/utility which uses the MON$ tables to perform the same operation.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I think that the engine can detect such 'system' connects like from gbak or nbackup (being called directly or via fbsvcmgr). Of course such transactions have to be preserved from being forcely commit / rollback.

> It seems that this issue is trying to solve application issues at the database level, that is not correct.

Why it is not correct ?
We already have some settings in firebird.conf that tries to solve some application issues (e.g. TempCacheLimit or ConnectionTimeout). I think that firebird.conf content shoudl NOT be abstract from concrete reality (environtment) of production database.

> if this were an issue for a developer, then they are free to build an application/utility which uses the MON$ tables

Yes, we made such 'utility' (cron + bash script), exactly in THIS manner few years ago.
But as for me this looks as temporary solution, because it is doing by external tools (cron + bash) and, furtermore, any new DBA whould be carefully 'dive' into this script (and many analogous) to understand what it does and how can it be updated.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

First, while I agree that the problem of long running TX can cause *possible* performance issues.

The proposed solution, however, would use a very heavy "hammer" to solve a problem which would need much finer control.

WRT the existing settings/options, I disagree that these are in place to solve application issues -- they are about supporting the database engine.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

DBA and application developers often do their job separately (both in space and time).
Application developers (who made end-user binary with poor TX management) can disappear and DBA will stay alone with countless problems which he can`t fix. Most unpleasant of these problems - performance issues in the middle of users' working time.

I suggest simple solution that can facilitate dayly usage of heavy-loaded database - even without need to know something about MON$-tables, cron (`at` on Windows) or bash / cmd script languages :-)

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

But your 'simple' solution will only have narrow use and not solve the real breath of issue -- it assumes that the unique variations of connection/transaction purposes can be discovered from knowledge which is available to the engine.

Further, I don't see how that will be possible without:
- adding additional properties to the connections/transactions to assist the evaluation process
- adding complex script/REGEX support to allow for the exceptionalities to be handled.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> it assumes that the unique variations of connection/transaction purposes can be discovered from knowledge

I think that only few tools from Firebird package should never be interrupted in such 'automated' mode: {gbak, nbackup, gfix, gstat}.

These names even can be hardcoded inside some 'checking' function. If current user = SYSDBA and process_name belongs to this list - do NOT interrupt it. Otherwise - check for timeout expired.

>Further, I don't see how that will be possible without:
> - adding additional properties to the connections/transactions to assist the evaluation process
> - adding complex script/REGEX support to allow for the exceptionalities to be handled.

I think there is no any need neither adding properties to connections/transactions nor any complex regexp.

PS. Eventually, this feature in should be DISABLED by default. It's up to DBA to use it. If there are some another (3rd party) programs that should not be interrupt - welcome to manually solution via cron + MON$-tables + bash / cmd script.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Looks like a duplicate for CORE985 (Transaction Timeout part).

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

I don't see it as a duplicate, certainly related though, because this case describes more 'inteligence' then that case describes.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue is related to CORE985 [ CORE985 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 4.0 Alpha 1 [ 10731 ]

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 4.0 Alpha 1 [ 10731 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: PizzaProgram Ltd. (szakilaci)

I agree on this is just a small part of CORE985 (Transaction Timeout part).
It would be much easier if ALL commands / transactions could be simply "timeouted". Like:
{code}
UPDATE WITH TIMEOUT 5000 invoices SET closed_time = CURRENT_TIMESTAMP WHERE ID = 123;
{code} ... or something similar.
Thanks ;)

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Link: This issue is replaced by CORE5488 [ CORE5488 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants