summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-11-03 12:08:16 +0530
committerDan Lambright <dlambrig@redhat.com>2015-11-07 10:32:33 -0800
commitf3b555e029e6531d914fb67e098929ffe03d161b (patch)
tree3bfed35c167a0c36d8b7eb1b0a72f5f344957062
parent41d7e780fb92ce7d8ab3df6d39baf17a023807a3 (diff)
tier/ctr: Ignore CTR Lookup heal insert errors
CTR doesnt read from the DB, so to make sure that file records are created it does a heal during a lookup. It remembers the decision in the inode context cache and retrys periodically. When the volume is restarted it looses all the inode cache from the previous time and CTR lookup heals tries the heal again, but this time it finds that the records are already there from sql and logs this error, and remembers this until the volume is restarted or inode is flushed out of inode cache of the brick. Solution: the log levels should be reduced to trace for this case and customers need not see this. Backport of http://review.gluster.org/#/c/12491/ Change-Id: I5f11e83c306ae912a90f12220f62bb7563b8eb96 BUG: 1279059 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/12534 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.c3
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3.c3
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3_helper.c5
3 files changed, 8 insertions, 3 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.c b/libglusterfs/src/gfdb/gfdb_data_store.c
index 937c7c6ff4a..e7ff815fc06 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.c
+++ b/libglusterfs/src/gfdb/gfdb_data_store.c
@@ -382,7 +382,8 @@ insert_record (gfdb_conn_node_t *_conn_node,
ret = db_operations_t->insert_record_op (gf_db_connection,
gfdb_db_record);
if (ret) {
- gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0,
+ gf_msg (GFDB_DATA_STORE, _gfdb_log_level (GF_LOG_ERROR,
+ gfdb_db_record->ignore_errors), 0,
LG_MSG_INSERT_OR_UPDATE_FAILED, "Insert/Update"
" operation failed");
}
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3.c b/libglusterfs/src/gfdb/gfdb_sqlite3.c
index 224c6ba6e53..642aa76697d 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3.c
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3.c
@@ -538,7 +538,8 @@ int gf_sqlite3_insert(void *db_conn, gfdb_db_record_t *gfdb_db_record)
case GFDB_FOP_WIND:
ret = gf_sql_insert_wind (sql_conn, gfdb_db_record);
if (ret) {
- gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,
+ gf_msg (GFDB_STR_SQLITE3, _gfdb_log_level (GF_LOG_ERROR,
+ gfdb_db_record->ignore_errors), 0,
LG_MSG_INSERT_FAILED, "Failed wind insert");
goto out;
}
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c
index 266840ab7b5..426fab0333e 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c
@@ -795,7 +795,10 @@ gf_sql_insert_wind (gf_sql_connection_t *sql_conn,
gfdb_db_record->link_consistency,
gfdb_db_record->ignore_errors);
if (ret) {
- gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,
+ gf_msg (GFDB_STR_SQLITE3,
+ _gfdb_log_level (GF_LOG_ERROR,
+ gfdb_db_record->ignore_errors),
+ 0,
LG_MSG_INSERT_FAILED, "Failed "
"inserting link in DB");
goto out;