Details
-
Bug
-
Resolution: Done
-
Major - P3
-
3.3.10
-
Fully Compatible
-
ALL
-
Integration 2016-08-29
-
0
Description
After this commit, it is no longer permissible to expose the ViewMap's begin() and end() iterators to external users. Because no mutex is held, the catalog's map may change at any time, invalidating the iterators. Instead, we should create an iterate() method that accepts a callback, and iterate through the ViewMap under the protection of the catalog's mutex.
In addition, we should call reloadIfNeeded() before beginning the iteration to sync with any changes to system.views.
Original Description
listCollections does not refresh the ViewCatalog before iterating through it, meaning that it won't be updated even if a change to system.views would have marked it as invalid.