Kouhei Sutou
null+****@clear*****
Sun Dec 28 23:45:05 JST 2014
Kouhei Sutou 2014-12-28 23:45:05 +0900 (Sun, 28 Dec 2014) New Revision: 0e18e680a3a7e0ee599720dcf8d318ffe19cccee https://github.com/groonga/groonga/commit/0e18e680a3a7e0ee599720dcf8d318ffe19cccee Message: grndb: implement check report Modified files: lib/mrb/scripts/command/grndb.rb Modified: lib/mrb/scripts/command/grndb.rb (+30 -3) =================================================================== --- lib/mrb/scripts/command/grndb.rb 2014-12-28 23:44:46 +0900 (ac99c5f) +++ lib/mrb/scripts/command/grndb.rb 2014-12-28 23:45:05 +0900 (c146a3f) @@ -81,9 +81,36 @@ module Groonga def check(database) all_unlocked = true database.each do |object| - next unless object.is_a?(Column) - if object.locked? - # TODO: Report + case object + when IndexColumn + next unless object.locked? + message = + "[#{object.name}] Index column is locked. " + + "It may be broken. " + + "Re-create index by --action=recover." + $stdout.puts(message) + all_unlocked = false + when Column + next unless object.locked? + name = object.name + message = + "[#{name}] Data column is locked. " + + "It may be broken. " + + "(1) Truncate the column (truncate #{name}) or " + + "clear lock of the column (lock_clear #{name}) " + + "and (2) load data again." + $stdout.puts(message) + all_unlocked = false + when Table + next unless object.locked? + name = object.name + message = + "[#{name}] Table is locked. " + + "It may be broken. " + + "(1) Truncate the table (truncate #{name}) or " + + "clear lock of the table (lock_clear #{name}) " + + "and (2) load data again." + $stdout.puts(message) all_unlocked = false end end -------------- next part -------------- HTML����������������������������...Download