@Override
          public String apply(ServiceComponentVersionEntity input) {
            return input.getRepositoryVersion().getVersion();
          }
Follows this version logic:
<table border="1">
  <tr>
    <th>DB hostcomponent1</th>
    <th>DB hostcomponentN</th>
    <th>DB desired</th>
    <th>New desired</th>
    <th>Repo State</th>
  </tr>
  <tr>
    <td>v1</td>
    <td>v1</td>
    <td>UNKNOWN</td>
    <td>v1</td>
    <td>CURRENT</td>
  </tr>
  <tr>
    <td>v1</td>
    <td>v2</td>
    <td>UNKNOWN</td>
    <td>UNKNOWN</td>
    <td>OUT_OF_SYNC</td>
  </tr>
  <tr>
    <td>v1</td>
    <td>v2</td>
    <td>v2</td>
    <td>v2 (no change)</td>
    <td>OUT_OF_SYNC</td>
  </tr>
  <tr>
    <td>v2</td>
    <td>v2</td>
    <td>v1</td>
    <td>v1 (no change)</td>
    <td>OUT_OF_SYNC</td>
  </tr>
  <tr>
    <td>v2</td>
    <td>v2</td>
    <td>v2</td>
    <td>v2 (no change)</td>
    <td>CURRENT</td>
  </tr>
</table>
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java