|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 | import logging |
15 | | - |
| 15 | +# for Python 2, don't use f-string |
16 | 16 | log = logging.getLogger(__name__) |
17 | 17 | import os |
18 | 18 | import sys |
@@ -118,8 +118,8 @@ def RecoverPartition(executor, db, partitions, endpoint_status): |
118 | 118 | db=db, table_name=table_name, pid=pid, leader_endpoint=leader_endpoint)) |
119 | 119 | status = executor.LoadTable(leader_endpoint, table_name, tid, pid) |
120 | 120 | if not status.OK(): |
121 | | - log.error("load table failed. db {db} name {table_name} tid {tid} pid {pid} endpoint {leader_endpoint} msg {status.GetMsg()}".format( |
122 | | - db=db, table_name=table_name, tid=tid, pid=pid, leader_endpoint=leader_endpoint, status=status)) |
| 121 | + log.error("load table failed. db {db} name {table_name} tid {tid} pid {pid} endpoint {leader_endpoint} msg {status}".format( |
| 122 | + db=db, table_name=table_name, tid=tid, pid=pid, leader_endpoint=leader_endpoint, status=status.GetMsg())) |
123 | 123 | return Status(-1, "recover partition failed") |
124 | 124 | if not partitions[leader_pos].IsAlive(): |
125 | 125 | status = executor.UpdateTableAlive(db, table_name, pid, leader_endpoint, "yes") |
@@ -204,8 +204,9 @@ def RecoverData(executor): |
204 | 204 | log.error("get all table failed") |
205 | 205 | return |
206 | 206 | for name in tables: |
| 207 | + # if recover failed, continue to recover next table |
207 | 208 | if not RecoverTable(executor, db, name).OK(): |
208 | | - return |
| 209 | + log.error("recover table failed. db {db} name {name}, check log for detail".format(db=db, name=name)) |
209 | 210 |
|
210 | 211 | def ChangeLeader(db, partition, src_endpoint, desc_endpoint, one_replica, restore = True): |
211 | 212 | log.info( |
|
0 commit comments