With Mongo 2.4 the Aggregation Operators $group has evolved.
The sub module mongodb_watchdog uses this operator to retrieve the "Top not-found" and Top access denied" watchdogs.
The count made within the reduce fonction doesn't work anymore.

I tested by replacing the reduce fonction by this version :

function (doc, accumulator) {
  accumulator.count++;
}

Comments

fgm’s picture

In 2.4, group can no longer access global functions or properties. This might be the cause.

Reference: http://docs.mongodb.org/manual/reference/command/group/#dbcmd.group

fgm’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

Actually, this is rather due to the fact that empty arrays are not automatically converted to hashes in V8 like they were on previous engines.

Here is a patch working on 2.4.5. Needs to be checked on earlier versions.

fgm’s picture

Rerolled with a good dose of refactoring: removed unused code, unused symbols, reduced overall complexity, extracted the MongoDB access logic on the "Top" pages to a storage-only class.

Malekou’s picture

Fixed the column order in "Top not-found" and Top access denied" tabs.

Edit : Tested with Mongo 2.2.1 and 2.0.1, works fine.

fgm’s picture

Title: Mongo 2.4 compatibility » Mongo Watchdog: MongoDB 2.4 compatibility

Adjusting topic.

chx’s picture

Status: Needs review » Needs work

I see no reason to refactor into classes in Drupal 7. The rest is valid.

jdwfly’s picture

Issue summary: View changes
Status: Needs work » Needs review

Ran into this issue today and went ahead and applied patch from #2. I'm running 2.4.9 and it seemed to clear up the issue for me. It would be nice to see at least that patch committed. I don't see why it couldn't since chx already commented that part was valid.

marcingy’s picture

Status: Needs review » Needs work
fgm’s picture

Status: Needs work » Reviewed & tested by the community

Just checked on 2.6.4 and #2 still works fine, and all watchdog tests pass, so it's good for me using the #2 patch.

fgm’s picture

Title: Mongo Watchdog: MongoDB 2.4 compatibility » Mongo Watchdog: MongoDB 2.4/2.6 compatibility

Adjusting topic.

slashrsm’s picture

Status: Reviewed & tested by the community » Fixed

Committed #2. Thanks

  • slashrsm committed 1189a88 on 7.x-1.x authored by fgm
    Issue #2038947 by fgm, Malekou: Mongo Watchdog: MongoDB 2.4/2.6...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.