Accumulo
  1. Accumulo
  2. ACCUMULO-2882

Initialize double-sets the initial configuration for the metadata and root tables

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Not A Problem
    • Affects Version/s: 1.6.0
    • Fix Version/s: None
    • Component/s: start
    • Labels:

      Description

      We handle initializing a new instance by calling a utility method on each of the metadata and root tables. That utility method ignores the passed table id and instead sets the initial table configs for each of the metadata and root tables.

      That means we end up setting them twice. I believe the action is idempotent (since we're using the same values each time), so no failure should result.

        public static void initMetadataConfig(String tableId) throws IOException {
          try {
            Configuration conf = CachedConfiguration.getInstance();
            int max = conf.getInt("dfs.replication.max", 512);
            // Hadoop 0.23 switched the min value configuration name
            int min = Math.max(conf.getInt("dfs.replication.min", 1), conf.getInt("dfs.namenode.replication.min", 1));
            if (max < 5)
              setMetadataReplication(max, "max");
            if (min > 5)
              setMetadataReplication(min, "min");
            for (Entry<String,String> entry : initialMetadataConf.entrySet()) {
               /* XXX There should only be one of these, and the table id should 
                           be the one passed in.
                 */
              if (!TablePropUtil.setTableProperty(RootTable.ID, entry.getKey(), entry.getValue()))
                throw new IOException("Cannot create per-table property " + entry.getKey());
              if (!TablePropUtil.setTableProperty(MetadataTable.ID, entry.getKey(), entry.getValue()))
                throw new IOException("Cannot create per-table property " + entry.getKey());
            }
          } catch (Exception e) {
            log.fatal("error talking to zookeeper", e);
            throw new IOException(e);
          }
        }
      

        Activity

        Hide
        Christopher Tubbs added a comment -

        I'm closing this one. The problem does not exist in the current code, and does not manifest as a bug in previous versions (just a redundant execution of an idempotent function).

        Show
        Christopher Tubbs added a comment - I'm closing this one. The problem does not exist in the current code, and does not manifest as a bug in previous versions (just a redundant execution of an idempotent function).
        Hide
        Christopher Tubbs added a comment -

        Some changes were made to Initialize since this patch was made. Also, the contributor's questions were left unanswered. This issue needs to be reviewed to determine if it is current.

        Show
        Christopher Tubbs added a comment - Some changes were made to Initialize since this patch was made. Also, the contributor's questions were left unanswered. This issue needs to be reviewed to determine if it is current.
        Hide
        Anson Liu added a comment -

        Hi Sean,

        Do you mean that initMetadataConfig should use passed tableID if supplied in parameter and create it's own ID as it currently does if not? Also should the passed tableID be used for both RootTable.ID and MetadataTable.ID? Thanks.

        Show
        Anson Liu added a comment - Hi Sean, Do you mean that initMetadataConfig should use passed tableID if supplied in parameter and create it's own ID as it currently does if not? Also should the passed tableID be used for both RootTable.ID and MetadataTable.ID? Thanks.
        Hide
        Sean Busbey added a comment -

        Hi Anson!

        1) I think your patch accidentally included previous commits from some other tickets. please review the guide for contributors and ensure you're generating a patch for only your fix for this issue.

        2) the initiMetadataConfig call should continue to use a passed tableID. rather than rely on idempotency to mask the bug, the function should properly only set table properties on the passed in table id.

        Show
        Sean Busbey added a comment - Hi Anson! 1) I think your patch accidentally included previous commits from some other tickets. please review the guide for contributors and ensure you're generating a patch for only your fix for this issue. 2) the initiMetadataConfig call should continue to use a passed tableID. rather than rely on idempotency to mask the bug, the function should properly only set table properties on the passed in table id.
        Hide
        Anson Liu added a comment -

        ACCUMULO-2882 Remove tableId parameter from initMetadataConfig() calls due to idempotency.

        Show
        Anson Liu added a comment - ACCUMULO-2882 Remove tableId parameter from initMetadataConfig() calls due to idempotency.

          People

          • Assignee:
            Anson Liu
            Reporter:
            Sean Busbey
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development