Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-3785

When importing 8.x cluster config, the xml schema needs to be updated correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None
    • None

    Description

      Summary
      When initializing a 9.1 system with a default cluster config with an 8.1 cache.xml file the cache XML file becomes corrupt.
      Description
      When initializing a 9.1 system with a default cluster config with an 8.1 cache.xml file the cache XML file becomes corrupt. To get a system into this state follow these steps.
      1. Start 2 or more locators.
      2. `import cluster-configuration --zip-file-name=cluster.zip` where the cluster configuration is an 8.1 cache.xml file.
      Example 8.1 cache.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <cache xsi:schemaLocation="http://schema.pivotal.io/gemfire/cache http://schema.pivotal.io/gemfire/cache/cache-8.1.xsd"
      version="8.1"
      xmlns="http://schema.pivotal.io/gemfire/cache" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <disk-store name="pdxDiskStoreddd"/>
      <disk-store name="regionDiskstore"/>

      <pdx disk-store-name="pdxDiskStoreddd" persistent="true"/>
      <region name="one" refid="PARTITION_PERSISTENT">
      <region-attributes disk-store-name="regionDiskstore"/>
      </region>

      <region name="two" refid="PARTITION_PERSISTENT"/>
      <region name="three" refid="PARTITION_PERSISTENT"/>
      <region name="four" refid="PARTITION_PERSISTENT"/>
      </cache>
      3. start up the cache servers to use the cluster-configuration
      4. Add a region which will intern mutate the cluster-configuration which will cause the problem.
      5. stop one cache server.
      6. restart the cache server and it will retrieve the faulty cluster.xml and it will refuse to start up.
      Example error:
      Starting a Geode Server in /Users/cblack/dev/projects/geode-patterns/geode-greenplum-realtime-loading/data/server3...
      The Cache Server process terminated unexpectedly with exit status 1. Please refer to the log file in /Users/cblack/dev/projects/geode-patterns/geode-greenplum-realtime-loading/data/server3 for full details.
      Exception in thread "main" org.apache.geode.cache.CacheXmlException: Error while parsing XML, caused by org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 324; cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'cache' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '8.1'.
      at org.apache.geode.internal.cache.xmlcache.CacheXml.error(CacheXml.java:890)
      at org.apache.geode.internal.cache.xmlcache.CacheXmlParser$DefaultHandlerDelegate.error(CacheXmlParser.java:3404)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:137)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2850)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2762)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2050)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
      at org.apache.geode.internal.cache.xmlcache.CacheXmlParser.parse(CacheXmlParser.java:224)
      at org.apache.geode.internal.cache.GemFireCacheImpl.loadCacheXml(GemFireCacheImpl.java:4287)
      at org.apache.geode.internal.cache.ClusterConfigurationLoader.applyClusterXmlConfiguration(ClusterConfigurationLoader.java:143)
      at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1193)
      at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:758)
      at org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:745)
      at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:173)
      at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:212)
      at org.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52)
      at org.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:860)
      at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:772)
      at org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:699)
      at org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:231)
      Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 324; cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'cache' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '8.1'.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      ... 36 more
      Bad Cache XML with the messed up name space. Also note that this isn't valid GemFire XML and would not pass the parse XML step by having elements out of order. Which is ok but makes importing into other system harder.
      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <cache xmlns="http://schema.pivotal.io/gemfire/cache" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd http://schema.pivotal.io/gemfire/cache http://schema.pivotal.io/gemfire/cache/cache-8.1.xsd">
      <region xmlns="http://geode.apache.org/schema/cache" name="charlie">
      <region-attributes data-policy="replicate" scope="distributed-ack"/>
      </region>
      <disk-store name="pdxDiskStoreddd"/>
      <disk-store name="regionDiskstore"/>
      <pdx disk-store-name="pdxDiskStoreddd" persistent="true"/>
      <region name="one" refid="PARTITION_PERSISTENT">
      <region-attributes disk-store-name="regionDiskstore"/>
      </region>
      <region name="two" refid="PARTITION_PERSISTENT"/>
      <region name="three" refid="PARTITION_PERSISTENT"/>
      <region name="four" refid="PARTITION_PERSISTENT"/>
      </cache>

      Attachments

        Activity

          People

            jinmeiliao Jinmei Liao
            jinmeiliao Jinmei Liao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: