@@ -87,7 +87,7 @@ func (r *aclTokenReplicator) FetchUpdated(srv *Server, updates []string) (int, e
8787 return len (r .updated ), nil
8888}
8989
90- func (r * aclTokenReplicator ) ensureUpdatedConsistent (updates []string ) ([]string , []string , error ) {
90+ func (r * aclTokenReplicator ) ensureRemoteConsistent (updates []string ) ([]string , []string , error ) {
9191 //return true if consistent updates,
9292 return []string {}, []string {}, nil
9393}
@@ -192,7 +192,7 @@ func (r *aclPolicyReplicator) FetchUpdated(srv *Server, updates []string) (int,
192192 return len (r .updated ), nil
193193}
194194
195- func (r * aclPolicyReplicator ) ensureUpdatedConsistent (updates []string ) ([]string , []string , error ) {
195+ func (r * aclPolicyReplicator ) ensureRemoteConsistent (updates []string ) ([]string , []string , error ) {
196196 updatedMap := make (map [string ]* structs.ACLPolicy )
197197 for _ , policy := range r .updated {
198198 updatedMap [policy .ID ] = policy
@@ -205,30 +205,30 @@ func (r *aclPolicyReplicator) ensureUpdatedConsistent(updates []string) ([]strin
205205
206206 //iterate over all updates array which are policy IDs check if the hash match for both
207207 var consistent bool = true
208- var deleted []string
209- var updated []string
208+ var remoteNotCreated []string
209+ var remoteNotUpdated []string
210210 var err error = nil
211211
212212 for _ , policyID := range updates {
213213 if updatedPolicy , ok := updatedMap [policyID ]; ok {
214214 if remotePolicy , ok := remoteMap [policyID ]; ok {
215215 if ! bytes .Equal (updatedPolicy .Hash , remotePolicy .Hash ) && updatedPolicy .ModifyIndex < remotePolicy .ModifyIndex {
216216 // remote stale batch did not get modified policy than what local diff calculated
217- updated = append (updated , policyID )
217+ remoteNotUpdated = append (remoteNotUpdated , policyID )
218218 consistent = false
219219 }
220220 }
221221 } else if remotePolicy , ok := remoteMap [policyID ]; ok && remotePolicy .ModifyIndex == remotePolicy .CreateIndex {
222222 // remote stale batch did not get the created policy than what local diff calculated
223- deleted = append (deleted , policyID )
223+ remoteNotCreated = append (remoteNotCreated , policyID )
224224 consistent = false
225225 }
226226 }
227227
228228 if ! consistent {
229229 err = errContainsStaleData
230230 }
231- return deleted , updated , err
231+ return remoteNotCreated , remoteNotUpdated , err
232232}
233233
234234func (r * aclPolicyReplicator ) DeleteLocalBatch (srv * Server , batch []string ) error {
@@ -352,7 +352,7 @@ func (r *aclRoleReplicator) FetchUpdated(srv *Server, updates []string) (int, er
352352 return len (r .updated ), nil
353353}
354354
355- func (r * aclRoleReplicator ) ensureUpdatedConsistent (updates []string ) ([]string , []string , error ) {
355+ func (r * aclRoleReplicator ) ensureRemoteConsistent (updates []string ) ([]string , []string , error ) {
356356 //return true if consistent updates,
357357 return []string {}, []string {}, nil
358358}
0 commit comments