Return-Path: Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: (qmail 98430 invoked from network); 3 Mar 2011 16:57:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 16:57:03 -0000 Received: (qmail 99950 invoked by uid 500); 3 Mar 2011 16:57:01 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 99898 invoked by uid 500); 3 Mar 2011 16:57:01 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 99716 invoked by uid 99); 3 Mar 2011 16:57:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 16:57:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 16:56:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0F7E04E66F for ; Thu, 3 Mar 2011 16:56:37 +0000 (UTC) Date: Thu, 3 Mar 2011 16:56:37 +0000 (UTC) From: "T Meyarivan (JIRA)" To: common-dev@hadoop.apache.org Message-ID: <519472433.11197.1299171397059.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Created: (HADOOP-7160) Configurable initial buffersize for getGroupDetails() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Configurable initial buffersize for getGroupDetails() ----------------------------------------------------- Key: HADOOP-7160 URL: https://issues.apache.org/jira/browse/HADOOP-7160 Project: Hadoop Common Issue Type: Improvement Components: native, security Affects Versions: 0.22.0 Reporter: T Meyarivan trunk/src/native/src/org/apache/hadoop/security/getGroup.c """ int getGroupDetails(gid_t group, char **grpBuf) { struct group * grp = NULL; size_t currBufferSize = sysconf(_SC_GETGR_R_SIZE_MAX); if (currBufferSize < 1024) { currBufferSize = 1024; } *grpBuf = NULL; char *buf = (char*)malloc(sizeof(char) * currBufferSize); if (!buf) { return ENOMEM; } int error; for (;;) { error = getgrgid_r(group, (struct group*)buf, buf + sizeof(struct group), currBufferSize - sizeof(struct group), &grp); if(error != ERANGE) { break; } free(buf); currBufferSize *= 2; buf = malloc(sizeof(char) * currBufferSize); if(!buf) { return ENOMEM; } ... """ For large groups, this implies at least 2 queries for the group (number of queries = math.ceil(math.log(response_size/1024, 2))) In the case of a large cluster with central user/group databases (exposed via LDAP etc), this leads to unnecessary load on the central services. This can be alleviated to a large extent by changing the initial buffer size to a configurable parameter -- -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira