All of lore.kernel.org
 help / color / mirror / Atom feed
From: marty <martinbarrowcliff@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: Ulogd deadlocks on server crash.
Date: Sat, 31 Dec 2011 11:34:52 -0500	[thread overview]
Message-ID: <4EFF39AC.9000701@gmail.com> (raw)

This is a critical situation with NFLOG logging to mysql.
I cannot call this a bug, so lets call it a feature request.
AFAIK this is specific to mysql.
Please let me explain what I have observed...

Lets assume our ulogd stored procedure does inserts and/or updates
to multiple tables with every NFLOG target execution.

Lets assume we are using an auto_increment column for an index number.

Now what happens if the machine crashes in the middle of
an operation?

Correct, we have used the index number, but it was never returned to
ulogd, and possibly not all the tables were populated.
That is a big problem, because from that point on,
NOTHING more will be logged! We are dead in the water.
And worse, no error was logged to tell us what is wrong!!!!

So how can we correct that problem?

We can manually remove all the entries that used that last index.
Baa, that assumes we actually know what is wrong...

Atomic transactions would be a perfect solution and at worst we
would rollback and lose one data entry. But is it guaranteed?
Ha. NOT always. Threads can be evil.
The only guarantee that we cannot get deadlocked would come from ulogd.

If, ulogd initiates an INSERT and does not get a returned index value
it "MIGHT" increment the last insert_id it is holding and try again a
limited number of times until it found a vacant row.
This would at least break the deadlock on the semi-used index id.
At the very least we could keep logging, even if one row was borked.
That would be a much better solution to this problem, IMHO.

Just a idea.
Thank you,

Marty B.


                 reply	other threads:[~2011-12-31 16:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EFF39AC.9000701@gmail.com \
    --to=martinbarrowcliff@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.