[Groonga-commit] groonga/groonga at 4c5f31b [master] logical_range_filter: support broken index column case

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Aug 29 18:09:18 JST 2016


Kouhei Sutou	2016-08-29 18:09:18 +0900 (Mon, 29 Aug 2016)

  New Revision: 4c5f31b27b8b819212d2922cfb9e774103d5fc34
  https://github.com/groonga/groonga/commit/4c5f31b27b8b819212d2922cfb9e774103d5fc34

  Message:
    logical_range_filter: support broken index column case

  Modified files:
    plugins/sharding/logical_table_remove.rb
    test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected
    test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected

  Modified: plugins/sharding/logical_table_remove.rb (+15 -3)
===================================================================
--- plugins/sharding/logical_table_remove.rb    2016-08-29 18:07:55 +0900 (20170d8)
+++ plugins/sharding/logical_table_remove.rb    2016-08-29 18:09:18 +0900 (9fbe693)
@@ -92,11 +92,15 @@ module Groonga
               context.clear_error
             when Table
               referenced_table_ids << range.id
-              range.indexes.each do |index_info|
+              indexes = range.indexes
+              context.clear_error
+              indexes.each do |index_info|
                 referenced_table_ids << index_info.index.domain.id
               end
             end
-            column.indexes.each do |index_info|
+            indexes = column.indexes
+            context.clear_error
+            indexes.each do |index_info|
               referenced_table_ids << index_info.index.domain.id
             end
           end
@@ -116,6 +120,7 @@ module Groonga
             begin
               table.remove(options)
             rescue
+              context.clear_error
               table.close
               remove_table_force(shard.table_name)
             end
@@ -165,7 +170,14 @@ module Groonga
             column_name = cursor.key
             Object.remove_force(column_name)
           else
-            column.remove(:dependent => @dependent)
+            begin
+              column.remove(:dependent => @dependent)
+            rescue
+              context.clear_error
+              colomn.close
+              column_name = cursor.key
+              Object.remove_force(column_name)
+            end
           end
         end
 

  Modified: test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected (+1 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected    2016-08-29 18:07:55 +0900 (9e8203f)
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected    2016-08-29 18:09:18 +0900 (773ca87)
@@ -61,6 +61,7 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000112>
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
+#|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
 #|e| [object][remove] column is broken: <Logs_20150204.path>: [object][remove] column is broken: <Logs_20150204.path>: [io][open] file size is too small: <8>(required: >= 64): <db/db.000011
 dump
 plugin_register sharding

  Modified: test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected (+1 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected    2016-08-29 18:07:55 +0900 (f359e71)
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected    2016-08-29 18:09:18 +0900 (d344789)
@@ -52,6 +52,7 @@ logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000112>
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
+#|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
 #|e| [object][remove] column is broken: <Logs_20150204.path>: [object][remove] column is broken: <Logs_20150204.path>: [io][open] file size is too small: <8>(required: >= 64): <db/db.000011
 #|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000112>
 #|e| grn_ctx_at: failed to open object: <274>(<Logs_20150204.path>):<64>(<column:fix_size>)
-------------- next part --------------
HTML����������������������������...
下載 



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