[Groonga-commit] groonga/groonga at b56b08e [master] logical_table_remove: support broken column case

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Aug 26 17:21:35 JST 2016


Kouhei Sutou	2016-08-26 17:21:35 +0900 (Fri, 26 Aug 2016)

  New Revision: b56b08e571def8569144d4896001090d6041c9b7
  https://github.com/groonga/groonga/commit/b56b08e571def8569144d4896001090d6041c9b7

  Message:
    logical_table_remove: support broken column case
    
    It seems that there are memory leak...

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

  Modified: plugins/sharding/logical_table_remove.rb (+6 -1)
===================================================================
--- plugins/sharding/logical_table_remove.rb    2016-08-26 17:20:32 +0900 (9f0cf8e)
+++ plugins/sharding/logical_table_remove.rb    2016-08-26 17:21:35 +0900 (2ee6493)
@@ -83,6 +83,7 @@ module Groonga
             end
           end
           columns.each do |column|
+            next if column.nil?
             range = column.range
             if range.is_a?(Table)
               referenced_table_ids << range.id
@@ -110,6 +111,7 @@ module Groonga
             begin
               table.remove(options)
             rescue
+              Context.instance.clear_error
               remove_table_force(shard)
             end
           else
@@ -136,6 +138,7 @@ module Groonga
         database.each_raw(:prefix => prefix) do |id, cursor|
           column = context[id]
           if column.nil?
+            Context.instance.clear_error
             column_name = cursor.key
             Object.remove_force(column_name)
           else
@@ -145,7 +148,9 @@ module Groonga
 
         # TODO: Remove objects that refers the table
 
-        Object.remove_force(shard.table_name)
+        if database[shard.table_name]
+          Object.remove_force(shard.table_name)
+        end
       end
 
       def remove_records(table)

  Added: test/command/fixture/sharding/logical_table_remove/broken (+1 -0) 100644
===================================================================
--- /dev/null
+++ test/command/fixture/sharding/logical_table_remove/broken    2016-08-26 17:21:35 +0900 (e4234d4)
@@ -0,0 +1 @@
+GROONGA

  Added: test/command/suite/sharding/logical_table_remove/broken/column/default.expected (+68 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/default.expected    2016-08-26 17:21:35 +0900 (e9256b9)
@@ -0,0 +1,68 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+[[0,0.0,0.0],true]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
+table_create NotRelated_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+[[0,0.0,0.0],true]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+[[0,0.0,0.0],3]
+logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border "include"
+[
+  [
+    [
+      -65,
+      0.0,
+      0.0
+    ],
+    "incompatible file format: <[object][remove] column is broken: <Logs_20150204.path>: [io][open] file size is too small: <8>(requ"
+  ]
+]
+#|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| [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
+
+#|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>)

  Added: test/command/suite/sharding/logical_table_remove/broken/column/default.test (+59 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/default.test    2016-08-26 17:21:35 +0900 (275a61d)
@@ -0,0 +1,59 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+
+#@disable-logging
+thread_limit 1
+database_unmap
+#@enable-logging
+
+#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000112
+
+logical_table_remove Logs timestamp \
+  --min "2015-02-04 00:00:00" \
+  --min_border "include"
+
+dump

  Added: test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected (+68 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent.expected    2016-08-26 17:21:35 +0900 (92b093b)
@@ -0,0 +1,68 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+[[0,0.0,0.0],true]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
+table_create NotRelated_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+[[0,0.0,0.0],true]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+[[0,0.0,0.0],3]
+logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border "include"   --dependent yes
+[
+  [
+    [
+      -65,
+      0.0,
+      0.0
+    ],
+    "incompatible file format: <[object][remove] column is broken: <Logs_20150204.path>: [io][open] file size is too small: <8>(requ"
+  ]
+]
+#|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| [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
+
+#|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>)

  Added: test/command/suite/sharding/logical_table_remove/broken/column/dependent.test (+60 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent.test    2016-08-26 17:21:35 +0900 (64dae12)
@@ -0,0 +1,60 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+
+#@disable-logging
+thread_limit 1
+database_unmap
+#@enable-logging
+
+#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000112
+
+logical_table_remove Logs timestamp \
+  --min "2015-02-04 00:00:00" \
+  --min_border "include" \
+  --dependent yes
+
+dump

  Added: test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected (+102 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.expected    2016-08-26 17:21:35 +0900 (f359e71)
@@ -0,0 +1,102 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+[[0,0.0,0.0],true]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
+table_create NotRelated_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+[[0,0.0,0.0],true]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+[[0,0.0,0.0],3]
+logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border "include"   --dependent yes   --force yes
+[[0,0.0,0.0],true]
+#|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| [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>)
+dump
+plugin_register sharding
+
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+
+table_create Times_20150203 TABLE_PAT_KEY Time
+
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+
+load --table Paths_20150203
+[
+["_key"],
+["/tmp/log"],
+["/var/"]
+]
+
+load --table Logs_20150203
+[
+["_id","path","timestamp"],
+[1,"/tmp/log",1422935340.0],
+[2,"/var/",1422975599.0]
+]
+
+load --table Paths_20150204
+[
+["_key"],
+["/tmp/log"],
+["/root/"],
+["/etc/aliases"]
+]
+
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION Paths_20150203 _key
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION Paths_20150204 _key
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp

  Added: test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.test (+61 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/dependent_force.test    2016-08-26 17:21:35 +0900 (459ece2)
@@ -0,0 +1,61 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+
+#@disable-logging
+thread_limit 1
+database_unmap
+#@enable-logging
+
+#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000112
+
+logical_table_remove Logs timestamp \
+  --min "2015-02-04 00:00:00" \
+  --min_border "include" \
+  --dependent yes \
+  --force yes
+
+dump

  Added: test/command/suite/sharding/logical_table_remove/broken/column/force.expected (+112 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/force.expected    2016-08-26 17:21:35 +0900 (a6d14b4)
@@ -0,0 +1,112 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150203 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+[[0,0.0,0.0],true]
+table_create Times_20150203 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
+table_create NotRelated_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+[[0,0.0,0.0],true]
+table_create Logs_20150204 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+[[0,0.0,0.0],true]
+table_create Times_20150204 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+[[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+[[0,0.0,0.0],3]
+logical_table_remove Logs timestamp   --min "2015-02-04 00:00:00"   --min_border "include"   --force yes
+[[0,0.0,0.0],true]
+#|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| [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>)
+dump
+plugin_register sharding
+
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+
+table_create Times_20150203 TABLE_PAT_KEY Time
+
+table_create Times_20150204 TABLE_PAT_KEY Time
+
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+
+load --table Paths_20150203
+[
+["_key"],
+["/tmp/log"],
+["/var/"]
+]
+
+load --table Logs_20150203
+[
+["_id","path","timestamp"],
+[1,"/tmp/log",1422935340.0],
+[2,"/var/",1422975599.0]
+]
+
+load --table Paths_20150204
+[
+["_key"],
+["/tmp/log"],
+["/root/"],
+["/etc/aliases"]
+]
+
+load --table Times_20150204
+[
+["_key"],
+[1422975600.0],
+[1423025340.0],
+[1423025400.0]
+]
+
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION Paths_20150203 _key
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION Paths_20150204 _key
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp

  Added: test/command/suite/sharding/logical_table_remove/broken/column/force.test (+60 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_table_remove/broken/column/force.test    2016-08-26 17:21:35 +0900 (85f9ab2)
@@ -0,0 +1,60 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Paths_20150203 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150203 TABLE_NO_KEY
+column_create Logs_20150203 timestamp COLUMN_SCALAR Time
+column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
+table_create Times_20150203 TABLE_PAT_KEY Time
+column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+
+table_create PathTerms_20150203 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
+table_create NotRelated_20150204 TABLE_NO_KEY
+
+table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
+table_create Logs_20150204 TABLE_NO_KEY
+column_create Logs_20150204 timestamp COLUMN_SCALAR Time
+column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
+table_create Times_20150204 TABLE_PAT_KEY Time
+column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
+
+table_create PathTerms_20150204 TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
+load --table Logs_20150203
+[
+{"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-03 23:59:59", "path": "/var/"}
+]
+
+load --table Logs_20150204
+[
+{"timestamp": "2015-02-04 00:00:00", "path": "/tmp/log"},
+{"timestamp": "2015-02-04 13:49:00", "path": "/root/"},
+{"timestamp": "2015-02-04 13:50:00", "path": "/etc/aliases"}
+]
+
+#@disable-logging
+thread_limit 1
+database_unmap
+#@enable-logging
+
+#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000112
+
+logical_table_remove Logs timestamp \
+  --min "2015-02-04 00:00:00" \
+  --min_border "include" \
+  --force yes
+
+dump
-------------- next part --------------
HTML����������������������������...
Download 



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