Multiple accounting records
aland at deployingradius.com
Wed Jul 14 10:54:11 CEST 2010
> However, I thought this through and when I make the following assumptions:
> - Freeradius has different SQL statements stored in its configuration
> for radacct update and insert;
> - It is Freeradius ' responsibility to decide whether to peform an
> insert or update; and
Not really. An "Acct-Status-Type = start" nearly always means insert.
An "Acct-Status-Type = Interim-Update" nearly always means update.
> - AcctSessionId and AcctUniqueId are unique identifiers for one session;
> there should be only exactly one record for each AcctSessionId and
That last assumption is *often* true, but is not *always* true. The
Acct-Session-Id field is sent by the NAS. It may be the same for many
user sessions. It may be different across different packets for the
"same" user session.
> Then there is still something amiss with the Freeradius updates of
> radacct. Even if erroneously session updates are sent in duplicate or
> with same or differing information, Freeradius should not insert a new
> record for an existing AcctSessionId and AcctUniqueId. Based on the
> above assumptions double entries for AcctSessionId and AcctUniqueId
> should never occur in radacct. Freeradius' insert/update logic should
> prevent that. However, multiple entries (anything between 2 and 17 in
> about 1% of all cases) is what we see in my extracts.
You can think abstractly about what *should* happen, or you can find
out what *is* happening. The server has a debug mode for a reason. You
should use it.
The SQL queries are editable for a reason. You can configure them to
do only inserts, only updates, or whatever you want.
More information about the Freeradius-Users