Kouhei Sutou
null+****@clear*****
Tue Aug 30 18:00:29 JST 2016
Kouhei Sutou 2016-08-30 18:00:29 +0900 (Tue, 30 Aug 2016) New Revision: 987fb165fcbb8c48a2f1e14a2957bb87bcc2697c https://github.com/groonga/groonga/commit/987fb165fcbb8c48a2f1e14a2957bb87bcc2697c Message: logical_table_remove: add missing force remove Added files: test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.expected test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.test test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent.expected test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent.test test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent_force.expected test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent_force.test test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/force.expected test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/force.test Modified files: plugins/sharding/logical_table_remove.rb Modified: plugins/sharding/logical_table_remove.rb (+12 -2) =================================================================== --- plugins/sharding/logical_table_remove.rb 2016-08-30 17:27:45 +0900 (3e9e910) +++ plugins/sharding/logical_table_remove.rb 2016-08-30 18:00:29 +0900 (067dca7) @@ -172,11 +172,21 @@ module Groonga case object when Table if object.domain_id == table_id - object.remove(:dependent => @dependent) + begin + object.remove(:dependent => @dependent) + rescue + context.clear_error + remove_table_force(object.name) + end end when Column if object.range_id == table_id - object.remove(:dependent => @dependent) + begin + object.remove(:dependent => @dependent) + rescue + context.clear_error + remove_column_force(object) + end end when nil context.clear_error Added: test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.expected (+135 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.expected 2016-08-30 18:00:29 +0900 (88673a1) @@ -0,0 +1,135 @@ +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] +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +[[0,0.0,0.0],true] +column_create Reference_20150204 data COLUMN_SCALAR Text +[[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 + ], + "[logical_table_remove] table is broken: <Logs_20150204>: [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.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +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 Reference_20150204 TABLE_HASH_KEY + +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"] +] + +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 +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) Added: test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.test (+62 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/default.test 2016-08-30 18:00:29 +0900 (855d9a8) @@ -0,0 +1,62 @@ +#@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 + +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +column_create Reference_20150204 data COLUMN_SCALAR Text + +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}.0000110 +#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000118 + +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/table_and_reference_table/dependent.expected (+135 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent.expected 2016-08-30 18:00:29 +0900 (2210803) @@ -0,0 +1,135 @@ +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] +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +[[0,0.0,0.0],true] +column_create Reference_20150204 data COLUMN_SCALAR Text +[[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 + ], + "[logical_table_remove] table is broken: <Logs_20150204>: [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.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +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 Reference_20150204 TABLE_HASH_KEY + +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"] +] + +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 +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) Added: test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent.test (+63 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent.test 2016-08-30 18:00:29 +0900 (c75c2e6) @@ -0,0 +1,63 @@ +#@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 + +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +column_create Reference_20150204 data COLUMN_SCALAR Text + +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}.0000110 +#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000118 + +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/table_and_reference_table/dependent_force.expected (+98 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent_force.expected 2016-08-30 18:00:29 +0900 (7899a45) @@ -0,0 +1,98 @@ +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] +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +[[0,0.0,0.0],true] +column_create Reference_20150204 data COLUMN_SCALAR Text +[[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.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [object][remove] column is broken: <Reference_20150204.data>: [object][remove] column is broken: <Reference_20150204.data>: [io][open] file size is too small: <8>(required: >= 64): <db/db.0 +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +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 Paths_20150203 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] +] + +column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION Paths_20150203 _key +column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp Added: test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent_force.test (+64 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/dependent_force.test 2016-08-30 18:00:29 +0900 (9cc6477) @@ -0,0 +1,64 @@ +#@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 + +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +column_create Reference_20150204 data COLUMN_SCALAR Text + +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}.0000110 +#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000118 + +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/table_and_reference_table/force.expected (+121 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/force.expected 2016-08-30 18:00:29 +0900 (eb86c43) @@ -0,0 +1,121 @@ +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] +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +[[0,0.0,0.0],true] +column_create Reference_20150204 data COLUMN_SCALAR Text +[[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.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [object][remove] column is broken: <Reference_20150204.data>: [object][remove] column is broken: <Reference_20150204.data>: [io][open] file size is too small: <8>(required: >= 64): <db/db.0 +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000118> +#|e| grn_ctx_at: failed to open object: <280>(<Reference_20150204.data>):<65>(<column:var_size>) +#|e| [io][open] file size is too small: <8>(required: >= 64): <db/db.0000110> +#|e| grn_ctx_at: failed to open object: <272>(<Logs_20150204>):<51>(<table:no_key>) +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/table_and_reference_table/force.test (+63 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_table_remove/broken/table_and_reference_table/force.test 2016-08-30 18:00:29 +0900 (4e03d57) @@ -0,0 +1,63 @@ +#@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 + +table_create Reference_20150204 TABLE_HASH_KEY Logs_20150204 +column_create Reference_20150204 data COLUMN_SCALAR Text + +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}.0000110 +#@copy-path fixture/sharding/logical_table_remove/broken #{db_path}.0000118 + +logical_table_remove Logs timestamp \ + --min "2015-02-04 00:00:00" \ + --min_border "include" \ + --force yes + +dump -------------- next part -------------- HTML����������������������������... Download