Problem/Motivation

Logger::ensureCappedCollection() in mongodb_watchdog runs the collStats command, only to read the capped flag of the request tracker collection.

MongoDB deprecated the collStats command in server 6.2: see its documentation. It still works on the currently supported servers (8.3, 8.0 and 7.0), but will fail once a server version removes it.

Proposed resolution

Read the flag from listCollections instead, which is not deprecated: $database->listCollections(['filter' => ['name' => $name]]), then CollectionInfo::isCapped() on the result. Both exist in the MongoDB library 2.x and 1.x, so this works with either driver.

Remaining tasks

  • MR.
  • Test against MongoDB 8.3, 8.0 and 7.0, for example in Docker containers, since CI only runs one server version.

User interface changes

None.

API changes

None.

Data model changes

None.

AI disclosure

This issue and MR are developed with AI assistance

Comments

fgm created an issue.