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

        Sean Busbey created issue -
        Anson Liu made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        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.
        Anson Liu made changes -
        Attachment ACCUMULO-2882.patch [ 12650191 ]
        Mike Drob made changes -
        Assignee Anson Liu [ ansonl ]
        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 -

        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.
        Corey J. Nolet made changes -
        Fix Version/s 1.6.1 [ 12325441 ]
        Corey J. Nolet made changes -
        Fix Version/s 1.6.2 [ 12328644 ]
        Corey J. Nolet made changes -
        Fix Version/s 1.6.3 [ 12329154 ]
        Fix Version/s 1.6.2 [ 12328644 ]
        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.
        Josh Elser made changes -
        Fix Version/s 1.8.0 [ 12329879 ]
        Fix Version/s 1.7.1 [ 12329940 ]
        Fix Version/s 1.7.0 [ 12324607 ]
        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).
        Christopher Tubbs made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 1.6.3 [ 12329154 ]
        Fix Version/s 1.8.0 [ 12329879 ]
        Fix Version/s 1.7.1 [ 12329940 ]
        Resolution Not A Problem [ 8 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2d 9h 38m 1 Anson Liu 13/Jun/14 01:09
        Patch Available Patch Available Resolved Resolved
        297d 17h 40m 1 Christopher Tubbs 06/Apr/15 18:49

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development