marklogic-community / roxy

Deployment tool for MarkLogic applications. Also provides optional unit test and XQuery MVC structure
Other
87 stars 66 forks source link

Forests with Replicas are not deleted by wipe #747

Open joeglorioso opened 7 years ago

joeglorioso commented 7 years ago

I used the configuration suggested in #408 to create forest replicas when bootstrapping MarkLogic. The ml local wipe command does not delete the forests.

<configuration>
  <assignments xmlns="http://marklogic.com/xdmp/assignments" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://marklogic.com/xdmp/assignments assignments.xsd">
    <assignment>
      <forest-name>@ml.content-db-rep1</forest-name>
      @ml.forest-data-dir-xml
    </assignment>
    <assignment>
      <forest-name>@ml.content-db-rep2</forest-name>
      @ml.forest-data-dir-xml
    </assignment>
    <assignment>
      <forest-name>@ml.content-db</forest-name>
      <replica-names>
        <replica-name>@ml.content-db-rep1</replica-name>
        <replica-name>@ml.content-db-rep2</replica-name>
      </replica-names>@ml.forest-data-dir-xml</assignment>
  </assignments>
  <databases xmlns="http://marklogic.com/xdmp/database" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://marklogic.com/xdmp/database database.xsd">
    <database>
      <database-name>@ml.content-db</database-name>
      <forests>
        <forest-id>@ml.content-db</forest-id>
      </forests>
    </database>
  </databases>
</configuration>

After ml local bootstrap: Database and Forests

screen shot 2017-02-14 at feb 14 2017 3 35 10 pm screen shot 2017-02-14 at feb 14 2017 3 35 28 pm

After ml local wipe: Database was deleted but Forests were not

screen shot 2017-02-14 at feb 14 2017 3 36 01 pm

This is on an ml-vagrant generated Linux cluster, using MarkLogic 8.0-6 and the April-2017-dev version of Roxy.

RobertSzkutak commented 7 years ago

Im curious, are they deleted if you perform a second wipe after the first one? Which version of Roxy and MarkLogic are you using? Thanks for the details, I will try to reproduce this soon.

joeglorioso commented 7 years ago

I tried this, but unfortunately they aren't deleted after a second wipe. I'm using MarkLogic 8.0-6 and the April-2017-dev version of Roxy

I'm not sure where this would be done in the Roxy code, but I believe that forests need to be "disconnected" from their replicas before deleting either. Perhaps that's the issue? For example:

xquery version "1.0-ml"; 

import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";

let $config := admin:get-configuration()
let $forest := xdmp:forest("forest-1")
let $replica-forest := xdmp:forest("forest-1r")
let $new-config := admin:forest-remove-replica($config, $forest, $replica-forest)
return admin:save-configuration($new-config)
joeglorioso commented 7 years ago

Any luck replicating this? Thanks!

jamsilvia commented 7 years ago

I haven't seen any movement on this - so I'll add it into some of the other work I'm doing for replicas.