paul-rogers opened a new pull request #2010: DRILL-7620: Fix plugin mutability 
isues
URL: https://github.com/apache/drill/pull/2010
 
 
   A recent commit made the plugin registry more strict about the rule that, 
once a plugin is registered, it must be immutable. A flaw enforcing that rule 
in the UI put the registry in an inconsistent state.
   
   ## Description
   
   The plugin registry maintains two maps: one from name to config, the other 
from config to instance. There is also a third: from config to instance, used 
for "ephemeral" plugins: those that appear in query plans but are not named.
   
   The config-to-instance map requires that a plugin be immutable once placed 
in the registry. Yet, as it turns out, we have quite a bit of code that changes 
plugins that reside in the registry. The UI did this: obtain a plugin, set the 
plugin to enabled/disabled, then update the registry. When this happens, the 
registry gets out of sync: the state of the plugin has already changed outside 
the registry, leaving the registry in the wrong state.
   
   Unit tests sometimes grab a file system config and add on a few format 
configs. Again, this makes the config in the registry inconsistent with its map 
entry.
   
   To help solve this problem, added methods to the registry to:
   
   * Enable/disable plugins by name, using the correct steps.
   * Copy a plugin for edit to discourage grabbing a config and changing it.
   * Properly add/remove format plugins for the file system config.
   
   A future PR may make plugin configs immutable. For now, we all must be on 
our best behavior not to change stored configs.
   
   ## Documentation
   
   None.
   
   ## Testing
   
   Added even more plugin registry unit tests. Made the tests more carefully 
honor the "immutable plugin rule." Manually performed the UI steps in the JIRA 
ticket.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to