[Groonga-mysql-commit] mroonga/mroonga at 4892dfb [master] storage: fix a bug that auto repair may cause crash

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 29 22:37:56 JST 2015


Kouhei Sutou	2015-10-29 22:37:56 +0900 (Thu, 29 Oct 2015)

  New Revision: 4892dfbee1639f607b28e4eb7968b4feb22e63d2
  https://github.com/mroonga/mroonga/commit/4892dfbee1639f607b28e4eb7968b4feb22e63d2

  Message:
    storage: fix a bug that auto repair may cause crash
    
    The following sequence causes crash:
    
      1. connection1: open indexes
      2. connection2: open indexes
      3. connection1: start operations log check and detects crash!
      4. connection2: start operations log check and blocked.
      5. connection1: finish auto repair by recreating indexes.
      6. connection2: is unblocked and detects no crash but has opened indexes
         that are recreated connection1.
      7. connection2: use dropped index and is crashed.
    
    TODO:
    
      * The same problem exists in wrapper mode.
      * Reduce lock scope. We can reduce lock scope by detecting "DISABLE
        KEYS" mode without opening indexes.
    
    [groonga-dev,03608]
    
    Reported by Hiroshi Kagami. Thanks!!!

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+3 -1)
===================================================================
--- ha_mroonga.cpp    2015-10-29 21:41:59 +0900 (2561f10)
+++ ha_mroonga.cpp    2015-10-29 22:37:56 +0900 (2e78086)
@@ -4292,6 +4292,9 @@ int ha_mroonga::storage_open(const char *name, int mode, uint open_options)
   }
 
   if (!(open_options & HA_OPEN_FOR_REPAIR)) {
+    // TODO: Reduce lock scope
+    mrn::Lock lock(&mrn_operations_mutex);
+
     error = storage_open_indexes(name);
     if (error) {
       storage_close_columns();
@@ -4303,7 +4306,6 @@ int ha_mroonga::storage_open(const char *name, int mode, uint open_options)
     storage_set_keys_in_use();
 
     {
-      mrn::Lock lock(&mrn_operations_mutex);
       mrn::PathMapper mapper(name);
       const char *table_name = mapper.table_name();
       size_t table_name_size = strlen(table_name);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index