]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: kill PG_STATE_SPLITTING 11824/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 8 Nov 2016 09:24:05 +0000 (17:24 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 8 Nov 2016 10:29:21 +0000 (18:29 +0800)
The PG_STATE_SPLITTING is never recorded and therefore is not traceable,
and removing the unnecessary code shall always be the preferred option.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/MonCommands.h
src/mon/PGMonitor.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index f20edb521a265ee01b2123eb0e2e845d8616ef39..6443f6aee97f0c8a4b8446ad3303c0ecd49cee78 100644 (file)
@@ -141,21 +141,21 @@ COMMAND("pg dump_stuck " \
        "pg", "r", "cli,rest")
 COMMAND("pg ls-by-pool " \
         "name=poolstr,type=CephString " \
-       "name=states,type=CephChoices,strings=active|clean|down|replay|splitting|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
+       "name=states,type=CephChoices,strings=active|clean|down|replay|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
        "list pg with pool = [poolname | poolid]", "pg", "r", "cli,rest")
 COMMAND("pg ls-by-primary " \
         "name=osd,type=CephOsdName " \
         "name=pool,type=CephInt,req=false " \
-       "name=states,type=CephChoices,strings=active|clean|down|replay|splitting|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
+       "name=states,type=CephChoices,strings=active|clean|down|replay|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
        "list pg with primary = [osd]", "pg", "r", "cli,rest")
 COMMAND("pg ls-by-osd " \
         "name=osd,type=CephOsdName " \
         "name=pool,type=CephInt,req=false " \
-       "name=states,type=CephChoices,strings=active|clean|down|replay|splitting|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
+       "name=states,type=CephChoices,strings=active|clean|down|replay|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
        "list pg on osd [osd]", "pg", "r", "cli,rest")
 COMMAND("pg ls " \
         "name=pool,type=CephInt,req=false " \
-       "name=states,type=CephChoices,strings=active|clean|down|replay|splitting|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
+       "name=states,type=CephChoices,strings=active|clean|down|replay|scrubbing|degraded|inconsistent|peering|repair|recovering|backfill_wait|incomplete|stale|remapped|deep_scrub|backfill|backfill_toofull|recovery_wait|undersized|activating|peered,n=N,req=false ", \
        "list pg with specific pool, osd, state", "pg", "r", "cli,rest")
 COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \
        "pg", "r", "cli,rest")
index 938c3bcc2a0d3d7fd07abd95f5845adb8806f865..5a062a9214443a4d5da8fd3e4973a3aa6fa7b85b 100644 (file)
@@ -1678,8 +1678,6 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
       note["peering"] += p->second;
     if (p->first & PG_STATE_REPAIR)
       note["repair"] += p->second;
-    if (p->first & PG_STATE_SPLITTING)
-      note["splitting"] += p->second;
     if (p->first & PG_STATE_RECOVERING)
       note["recovering"] += p->second;
     if (p->first & PG_STATE_RECOVERY_WAIT)
@@ -1777,7 +1775,6 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
                                PG_STATE_INCONSISTENT |
                                PG_STATE_PEERING |
                                PG_STATE_REPAIR |
-                               PG_STATE_SPLITTING |
                                PG_STATE_RECOVERING |
                                PG_STATE_RECOVERY_WAIT |
                                PG_STATE_INCOMPLETE |
index dc6acbbda052f217d3b0d52037c8d4b5f3e7cb76..5be998583b28fe5d2fd9eaff7201c3ae1c967cb1 100644 (file)
@@ -801,8 +801,6 @@ std::string pg_state_string(int state)
     oss << "down+";
   if (state & PG_STATE_REPLAY)
     oss << "replay+";
-  if (state & PG_STATE_SPLITTING)
-    oss << "splitting+";
   if (state & PG_STATE_UNDERSIZED)
     oss << "undersized+";
   if (state & PG_STATE_DEGRADED)
@@ -849,8 +847,6 @@ int pg_string_state(const std::string& state)
     type = PG_STATE_DOWN;
   else if (state == "replay")
     type = PG_STATE_REPLAY;
-  else if (state == "splitting")
-    type = PG_STATE_SPLITTING;
   else if (state == "scrubbing")
     type = PG_STATE_SCRUBBING;
   else if (state == "degraded")
index 5bf08c1c396567e6230751703e3ca2e030e70357..38b99648b65384cb07283188f1fe5ca18f46380f 100644 (file)
@@ -916,7 +916,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) {
 #define PG_STATE_DOWN         (1<<4)  // a needed replica is down, PG offline
 #define PG_STATE_REPLAY       (1<<5)  // crashed, waiting for replay
 //#define PG_STATE_STRAY      (1<<6)  // i must notify the primary i exist.
-#define PG_STATE_SPLITTING    (1<<7)  // i am splitting
+//#define PG_STATE_SPLITTING    (1<<7)  // i am splitting
 #define PG_STATE_SCRUBBING    (1<<8)  // scrubbing
 //#define PG_STATE_SCRUBQ       (1<<9)  // queued for scrub
 #define PG_STATE_DEGRADED     (1<<10) // pg contains objects with reduced redundancy