-
Notifications
You must be signed in to change notification settings - Fork 102
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
Spurious error on duplicate keys with admin sync #11
Comments
agouaux. Could you please explain what you expected and how the result was unexpected? As far as I understood: Owners have already been registered in admin_table, and thanks to primary-key constraint of the table, duplicate registrations were avoided. |
I think that this is caused by the stupid caching of admins and friends in 6.2. |
I upgraded to 6.2.18, but the problem persists. Here's an example. List is called ecs.ee.allfac, and it includes the list etech for both the admins and editors. That has been working fine for a long time. However, after going to 6.2, now whenever I edit the List Definition, I get the following error message:
along with this nasty error message on the screen: So I agree that on one hand it is a non-serious error since it is just trying to add a duplicate entry, but:
Here's the log for when this occurs. |
Here's the list config, if that matters:
and here's SYMPA_HOME/etc/data_sources/owner_or_moderator_sympa_list.incl
|
I guess nobody has been able to reproduce this error? We're still routinely getting the errors that are shown in the log excerpt attached to the original comment.... |
I got a similar error recently on a new Sympa 6.2.18 setup. I suppose we need to find the place in the code where it submits the list definition update and clear the cache before that. |
I'm trying to understand... how is it a cache issue? It is as if the code
is trying to add all the owners included from another source as owners,
when in fact they were already added as owners. That behavior doesn't
sound like something that is caching, but rather something that is not
remembering. It's as if it is not double-checking that those included
owners are not already added before attempting to add them again.
Anyway, despite wanting to dig into the code to learn for myself what's
going on, I just haven't had the time to do so. Consequently, I'm just
totally guessing here....
…On Sun, Sep 10, 2017 at 8:56 AM, Stefan Hornburg (Racke) < ***@***.***> wrote:
I got a similar error recently on a new Sympa 6.2.18 setup. I suppose we
need to find the place in the code where it submits the list definition
update and clear the cache before that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AaGNNfBPbD4McasOFODgL18IDGqG2Y0aks5sg-qIgaJpZM4NEr6m>
.
|
Milestone means that we will try to solve this issue in this year. Helps are appreciated! |
Please check 6.2.23b.2 Note: This bug looks related with issue #7. |
If problem will not be reported reproducing by 14 Dec., I'll close this issue. |
Unfortunately, problem persists: [root@aistsympa01 ~]# grep VERSION /deploy/sympa/bin/Sympa/Constants.pm The stest1 list includes owners and editors from other lists:
and etc/data_sources/owner_or_moderator_sympa_list.incl includes the following:
|
|
I get this in the web interface when I attempt to add the same address as both an owner and a moderator. This is pretty consistently repeatable. and this is the error message that listmaster receives:
The new address seems to be added to both owner and moderator despite the warning screen popup and the alert to listmaster. If I add a new address as just owner, I get the error in the log about duplicate address being added (from the included lists), but no error in the GUI, and no error to list master. No error if delete same address from both owner and moderator. Sometimes, if address "a" is listed as an owner already (an Update previously done), then I add address "a" as a moderator, I get the error popup in the GUI and the alert to the listmaster. Though, once again if I subsequently check the list config, it appears the update was registered nonetheless. This doesn't happen all the time, but sometimes. Whenever the sync update for the included lists for owner and moderator runs, I get the duplicate errors in the logs. If I have a number of lists configured this way, it results in a lot of errors in the logs, and probably a lot of needless chatter to the db server because it is trying to add addresses to either owner or moderator that are already listed in the db. It's as if it's not doing a query first before trying to add, but simply trying to add all the time those syncs are preformed. |
@agouaux, thanks for detailed report! Spurious error messages are problem, however I look it a bit difficult to fix right away. So I think this issue would be kept open and would be fixed in the near future (next spring or ahead). Until then, please be patient ignoring the error messages. |
can someone please explain the intent of this logic:
I added more logging statements, and it seems like this may not be doing quite what folks are intending....
|
This seems to work better for updating the inclusion table. Though, not sure what triggers the DELETE to occur.... (OK, the DELETE is to cleanup entries that should no longer be there.) I've tested this minor change a bunch, and it seems to eliminate the error associated when updating the inclusion table. The other error--adding the same address as owner and editor at once--I'm wondering if it could be something as simple as a COMMIT not being done after an INSERT or UPDATE.....
|
well, the business of getting the error popup and the error in the logs is definitely because of the cache. If I make this simple change:
The error popup no longer appears when adding an address as both owner and editor with one 'Update'. (Also no error in the logs.) I see that I'd hate to disable the cache altogether, though. What would happen if this cache expiry file was missing altogether? Perhaps the WWW interface should pass an argument so that is done, so basically no caching when doing an edit via the WWW client? |
Well, this patch seems to be working. So far all the above mentioned errors are not present. It contains the code for _update_inclusion_table mentioned previously. It also does a force load into the admin cache when an owner or editor is added, removed, or updated. |
Does this feature affect? |
I don’t see how it would be at all related. I didn’t change any of the actual SQL.
… On Dec 20, 2017, at 4:43 AM, IKEDA Soji ***@***.***> wrote:
Does this feature affect?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Please try with this patch:
|
I will, but I don't think it'll make any difference to what I was seeing. I put in a ton, and I mean a TON of syslog statements all throughout the code to get a better idea of what was going on. What I discovered is that when the same address was added as owner and editor at once, the loop that goes through the admins the second time around didn't know the admin had been added to the table. That's because the vehicle that determined when another SELECT was preformed to update the cache is based on the mtime of a file. This mtime, as I'm sure you know, is the number of seconds since EPOCH--a value that on a machine of any speed at all isn't granular enough. So, in that logic loop, mtime was checked here:
and since the milliseconds since the admin was already added to the table, the cache had become stale. This was quite reproducible. So, what I did is add this to the end of add_list_admin, update_list_admin, delete_list_admin:
then I just added this to get_admins:
and this to _get_admins:
Effectively, at least for updating admins, ignoring whatever the mtime on that file was. With that change, right after an admin is updated, a select is done for that $role in the user_admin table, thereby updating the cache. The next time sync_include_admin looped through to see if that admin needed to be added, they were now in the cache, and so no errors about adding a duplicate entry. I don't know if it's the best way to go about rectifying the issue, but it seems to work predictably, the SQL server isn't doing SELECT on user_admin constantly (say if cache entirely disabled), and I'm not seeing any errors in the logs, nor error pop-ups in the web GUI. |
On my side it could applied to 6.2.24. Anyway, please see the documentation to build with 6.2-branch (see descriptions about development version). Thanks. |
Well, I just seem to find ways to be contrary! ;-) It's truly not my intention.
ok, so trying this..
|
Well, looks like a configure script was created nonetheless, so I proceeded with the install. This is what I did:
(/deploy/www is where Apache looks for the fcgi scripts.) Sadly, when I try to add the same address for both owner and editor, then click Update, I still get the error pop-up in the screen, and this is logged.
|
@agouaux, can you show the content of
|
|
…updated by sync_include_admin().
I missed a change. @agouaux, can you please apply this additional patch (keeping previous patch applied), and try again? |
OK, I blew away my git pull and did a fresh, new git pull of everything. I built/deployed sympa, and it now looks as if this particular error is now gone! :-) |
Really? @agouaux, thanks for testing! If you don't find problem, please use these patches for the time being. However, I think these would not be better to be included into Sympa. Because, what I know by trials so far is that, I'll submit another PR in some other day (by the time of 6.2.26b.2?). Then, I'll investigate another problem (key errors on |
Well, I think I finally figured out the DUPLICATE errors I was getting during attempts to update admin_table. These errors were occurring for lists that included other lists for either the owner and editor. On these other lists, in the example below, "etech", there were some members with addresses in mixed case:
However, somewhere along the process of adding addresses into the DB, they are converted to all lower-case, as they should. Yet, the logic that goes through and compares the old addresses and those that need to be added, it wasn't first lower-casing the new addresses. So, it tried to add the newer (mixed-case) addresses. When it did so, however, that's when it lower-cased the address, which meant it was adding an address already there. This resulted in the DUPLICATE errors.
When I converted all the members on the "etech" list (removed them, then added them back in lower-case), the errors and problems disappeared. For now I've instructed the admin of the "etech" list to please be sure to only add the addresses in lower-case. |
Actually, the case thing also appears to be an issue when you include the members of one list (a) to the members of another list (b). So, if [email protected] is a member of (a), and list (b) includes the members of list (a), then there will be errors like so:
Notice the error message as "first.last", and not "First.Last". |
… admin sync - Now sync_include_admin() passes cache and updates admin_table directly. - It no longer reload owner/editor in list config. Known bug: Big datasource consumes large memory.
Modification to fix the bug fundamentally needs some time, and I will apply tentative patch above. Milestone is postponed to 6.2.28. |
… admin sync - Now sync_include_admin() passes cache and updates admin_table directly. - It no longer reload owner/editor in list config. Known bug: Big datasource consumes large memory.
… admin sync - Now sync_include_admin() passes cache and updates admin_table directly. - It no longer reload owner/editor in list config. Known bug: Big datasource consumes large memory.
#11: Spurious error on duplicate keys with admin sync, and changes on configuration for owners/moderators
Fix was merged and will be released as a part of next beta, 6.2.33b.1. This issue is closed. Thanks! |
I didn't know if this was something separate from #7 or something different. #7 deals with editing the admins (owners and/or editors). However, this problem has to do with syncing these admins from a datasource. I'm going to attached an excerpt of the log regarding such a sync. The lines with "AAG" are additional log statements I inserted in an attempt to get more information about this. One thing that's frustrating is that I have not been able to replicate this behavior on the test system, despite them having the same sympa version, same perl version, same module versions (at least mostly.)
In the attached log excerpt, the list "ecs.bmen.staff" includes the list "etech" as owners.
etech-sympa-log.txt
The text was updated successfully, but these errors were encountered: