Revision 953a7f16 src/raft/RaftManager.cc

View differences:

src/raft/RaftManager.cc
1151 1151

  
1152 1152
	pthread_mutex_lock(&mutex);
1153 1153

  
1154
	if ( state == SOLO )
1155
	{
1156
		lindex = 0;
1157
		lterm  = 0;
1158
	}
1159

  
1160 1154
    oss << "<RAFT>"
1161 1155
        << "<SERVER_ID>" << server_id << "</SERVER_ID>"
1162 1156
        << "<STATE>"     << state << "</STATE>"
1163 1157
        << "<TERM>"      << term << "</TERM>"
1164 1158
        << "<VOTEDFOR>"  << votedfor << "</VOTEDFOR>"
1165
        << "<COMMIT>"    << commit << "</COMMIT>"
1166
        << "<LOG_INDEX>" << lindex << "</LOG_INDEX>"
1167
        << "<LOG_TERM>"  << lterm  << "</LOG_TERM>"
1168
        << "</RAFT>";
1159
        << "<COMMIT>"    << commit << "</COMMIT>";
1160

  
1161
	if ( state == SOLO )
1162
	{
1163
        oss << "<LOG_INDEX>-1</LOG_INDEX>"
1164
            << "<LOG_TERM>-1</LOG_TERM>";
1165
	}
1166
    else
1167
    {
1168
        oss << "<LOG_INDEX>" << lindex << "</LOG_INDEX>"
1169
            << "<LOG_TERM>"  << lterm  << "</LOG_TERM>";
1170
    }
1171

  
1172
    oss << "</RAFT>";
1169 1173

  
1170 1174
	pthread_mutex_unlock(&mutex);
1171 1175

  

Also available in: Unified diff