You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2021/10/07 16:32:00 UTC

[jira] [Created] (RANGER-3469) Off-By-One Error in XUser Syncing

David Mollitor created RANGER-3469:
--------------------------------------

             Summary: Off-By-One Error in XUser Syncing
                 Key: RANGER-3469
                 URL: https://issues.apache.org/jira/browse/RANGER-3469
             Project: Ranger
          Issue Type: Improvement
          Components: Ranger
            Reporter: David Mollitor


{code:java|title=PolicyMgrUserGroupBuilder.java}
int uploadedCount = -1;
int pageSize = Integer.valueOf(recordsToPullPerCall);
while (uploadedCount < totalCount) {
	...
	GetXGroupListResponse pagedXGroupList = new GetXGroupListResponse();
	int pagedXGroupListLen = uploadedCount+pageSize;
	pagedXGroupList.setXgroupInfoList(xGroupList.getXgroupInfoList().subList(uploadedCount+1,pagedXGroupListLen>totalCount?totalCount:pagedXGroupListLen));
{code}
The size of the first batch of users to sync is:
{code:java}
int uploadedCount = -1;
// default in value is 1000
int pageSize = Integer.valueOf(recordsToPullPerCall);

// value is 1000 + -1 = 999
int pagedXGroupListLen = uploadedCount+pageSize;
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)