Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-23231

ReplicationSource do not update metrics after refresh

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 3.0.0, 2.3.0, 2.1.8, 2.2.3
    • Component/s: wal
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When replication refresh to new state, it will create a new source and terminate the old source and replace the old source with new source.

        public void refreshSources(String peerId) throws IOException {
          String terminateMessage = "Peer " + peerId +
            " state or config changed. Will close the previous replication source and open a new one";
          ReplicationPeer peer = replicationPeers.getPeer(peerId);
          ReplicationSourceInterface src = createSource(peerId, peer);
          // synchronized on latestPaths to avoid missing the new log
          synchronized (this.latestPaths) {
            ReplicationSourceInterface toRemove = this.sources.put(peerId, src);
            if (toRemove != null) {
              LOG.info("Terminate replication source for " + toRemove.getPeerId());
              toRemove.terminate(terminateMessage);
            }
            for (NavigableSet<String> walsByGroup : walsById.get(peerId).values()) {
              walsByGroup.forEach(wal -> src.enqueueLog(new Path(this.logDir, wal)));
            }
          }
          LOG.info("Startup replication source for " + src.getPeerId());
          src.startup();
      

      terminate replication source will remove all metrics, current terminate replication source be called after create new source which do init metrics, so the result is there is no corresponding metrics after refresh replication source.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                binlijin Lijin Bin
                Reporter:
                binlijin Lijin Bin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: