CDR export jobs such as ama exporter or cdr-exporter must never execute
on both active/passive node. because the output folder resides on a
glusterfs filesystem, this will cause merged or duplicate files, and
calls charged twice to customers subsequentially.
for .ama, the 2-phase commit steps for exporting CDRs were separated
already:
(a) rename .tmp file to final output file name
(b) commit db transaction:
- cdrexportstatus of all cdrs of that file
- file sequence number increment
The implemented 2PC flow will prevent (a) properly, if (b) fails.
This is now leveraged (by escalating the UPSERT not changing anything) to
abandon a whole file, if a single CDR shows an exportstatus other than
"unexported". Such CDRs indicate there is a race condition with another
exporter (which was quicker here).
the same thechnique also has to be added to cdr-exporter, which
unfortunately has no 2PC flow impl yet.
Change-Id: Ice40fa79d2b263018ee7825e314d63c9abe888ce
(cherry picked from commit e0d143ec3b)
if the number of exisiting subscribers (used as caller/callee
in created cdrs) is low, there is a higher risk that it can
fail to randomize one.
Change-Id: Id8f37f259e07f1b50251008a207a3e6122a628ea
(cherry picked from commit 71d805440a)
This reduces the complexity of the algorithm, at the expense of more
code, which makes it faster:
Rate old new
old 57803/s -- -23%
new 74906/s 30% --
Change-Id: Ic230cddceb269e4c452f3713e75be16569908458
(cherry picked from commit 520e67ed67)
Switch to early next iterations, and fold two consecutive ifs into one.
Change-Id: I2184a190dc1dd7cc303b52ece39a23deb28abb2c
(cherry picked from commit a551ce2246)
Unix systems default to using /bin/sh when trying to run an executable
script that has no shebang.
Change-Id: I18ef857fbc54fd72e6ad06b0f85c8c908fb0880d
(cherry picked from commit 85d59d562a)
We require these with perlcritic, but have not been triggered as these
scripts have no shebang, which we will be adding later.
Change-Id: I81ac98c9ee72cce9b3446a98e1aae53e4c04b578
(cherry picked from commit 803bacf8a5)
This confuses perlritic, which consider this a pair of statements
separated by a comma.
Change-Id: I3c67c2fff03e5142a0dc284221dd0cc991ae052d
(cherry picked from commit dbd7ac7e7a)
This adds a behavior change, reflected in the unit test changes, by
always returning the lowercased versions of the array elements when
case insensitiveness is enabled. This should be fine, given that we
do not care from the callers PoV, and the result might have changed
depending on the order of the inputs.
Change-Id: I44896183b566e921cc1287f106fb4bb9332acb97
(cherry picked from commit 9485368290)
We do not need to add one item at a time, push accepts a list as an
argument.
Change-Id: I30d81f941c1ce91cb2ed90662cbd9e9daf6fa09f
(cherry picked from commit 0991288e50)
This makes it possible to easily extend the function to support new
units.
Change-Id: I9e0935fb20013e962e48ec6e27a04d01cd9730be
(cherry picked from commit 7857a1c575)
These are core modules, which require no additional dependencies.
Change-Id: I8dbda5142dcc9d095a2c703ef6cee5364d2ba55a
(cherry picked from commit e6ebcc15c5)
This is a core module, which requires no additional dependencies.
Change-Id: I0830f022788a5e7b69b0afa462654fabf277e254
(cherry picked from commit 018eafb770)
This is a core module, which requires no additional dependencies.
Change-Id: I93a2c3fd75fd7790461ccc694ed73c4899a1ef20
(cherry picked from commit 72d7000151)
Which is also around 300% faster:
Rate had-hoc sprintf
had-hoc 3508772/s -- -75%
sprintf 14084507/s 301% --
Change-Id: I5ebce0058473f9de08c381739646a20e42308a8f
(cherry picked from commit 561e36d08c)
- try fallback to source_user
- use "00000000000" for open_digits
Change-Id: Iae377b99b7eee338cce556b78ffd9be890fb919d
(cherry picked from commit ebbc3762e7)