Skip to content

Commit

Permalink
Update for name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
databyjp committed Oct 11, 2024
1 parent a7e559e commit 4301cb8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
12 changes: 6 additions & 6 deletions _includes/code/howto/manage-data.collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
client.close()

# ==============================================
# ===== REPLICATION WITH ObjectDeletionConflictResolution
# ===== REPLICATION WITH DeletionStrategy
# ==============================================

# Connect to a setting with 3 replicas
Expand All @@ -503,25 +503,25 @@
# Clean slate
client.collections.delete("Article")

# START ObjectDeletionConflictResolution
from weaviate.classes.config import Configure, ObjectDeletionConflictResolution
# START DeletionStrategy
from weaviate.classes.config import Configure, DeletionStrategy

client.collections.create(
"Article",
replication_config=Configure.replication(
factor=3,
async_enabled=True,
# highlight-start
object_deletion_conflict_resolution=ObjectDeletionConflictResolution.PERMANENT_DELETION # Or ObjectDeletionConflictResolution.NO_AUTOMATED_RESOLUTION
deletion_strategy=DeletionStrategy.DELETE_ON_CONFLICT # Or DeletionStrategy.NO_AUTOMATED_RESOLUTION
# highlight-end
)
)
# END ObjectDeletionConflictResolution
# END DeletionStrategy

# Test
collection = client.collections.get("Article")
config = collection.config.get()
# assert config.replication_config.object_deletion_conflict_resolution == ObjectDeletionConflictResolution.PERMANENT_DELETION # Something like this for the test?
# assert config.replication_config.deletion_strategy == DeletionStrategy.DELETE_ON_CONFLICT # Something like this for the test?

client.close()

Expand Down
12 changes: 6 additions & 6 deletions _includes/code/howto/manage-data.collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,28 +573,28 @@ await client.collections.create({
// TODO NEEDS TEST assert.equal(result.replicationConfig.factor, 3);

// =======================
// ===== ObjectDeletionConflictResolution ====
// ===== DeletionStrategy ====
// =======================

// /*
// // START ObjectDeletionConflictResolution
// // START DeletionStrategy
// import { configure } from 'weaviate-client';

// // END ObjectDeletionConflictResolution
// // END DeletionStrategy
// */

// // START ObjectDeletionConflictResolution
// // START DeletionStrategy
// await client.collections.create({
// name: 'Article',
// // highlight-start
// replication: configure.replication({
// factor: 3,
// asyncEnabled: true,
// objectDeletionConflictResolution: 'permanentDeletion'
// DeletionStrategy: 'permanentDeletion'
// }),
// // highlight-end
// })
// // END ObjectDeletionConflictResolution
// // END DeletionStrategy

// ====================
// ===== SHARDING =====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Async replication supplements the repair-on-read mechanism. If a node becomes in

To activate async replication, set `asyncEnabled` to true in the [`replicationConfig` section of your collection definition](../../manage-data/collections.mdx#replication-settings).

### Object deletion conflict resolution
### Deletion strategy

:::info Added in `v1.27`
:::
Expand All @@ -202,13 +202,13 @@ This can lead to a conflict where the deleted object can still be read, or where

To resolve this, you can set an option in the replication config section of each collection.

The available strategies are:
The available deletion strategies are:

- `PermanentlyDelete` - The object is deleted from all replicas.
- `DeleteOnConflict` - The object is deleted from all replicas.
- `NoAutomatedResolution` - Conflicts in deletions are resolved in the same way as other conflicts.

:::tip Related pages
- See [this how-to page](../../configuration/replication.md#object-deletion-conflict-resolution) for an example of how to set the object deletion conflict resolution strategy.
- See [this how-to page](../../configuration/replication.md#deletion-strategy) for an example of how to set the object deletion conflict resolution strategy.
:::

## Related pages
Expand Down
11 changes: 7 additions & 4 deletions developers/weaviate/configuration/replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ image: og/docs/configuration.jpg
# tags: ['configuration', 'operations', 'monitoring', 'observability']
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';

Weaviate instances can be replicated. Replication can improve read throughput, improve availability, and enable zero-downtime upgrades.

For more details on how replication is designed and built in Weaviate, see [Replication Architecture](../concepts/replication-architecture/index.md).
Expand Down Expand Up @@ -62,7 +66,7 @@ import ReplicationConfigWithAsyncRepair from '/_includes/code/configuration/repl

<ReplicationConfigWithAsyncRepair />

### Object deletion conflict resolution
### Deletion strategy

import ManageDataPyCode from '!!raw-loader!/_includes/code/howto/manage-data.collections.py';
import ManageDataTSCode from '!!raw-loader!/_includes/code/howto/manage-data.collections.ts';
Expand All @@ -76,8 +80,8 @@ You can optionally set a collection option on how to resolve object deletion con
<TabItem value="py" label="Python Client v4">
<FilteredTextBlock
text={ManageDataPyCode}
startMarker="# START ObjectDeletionConflictResolution"
endMarker="# END ObjectDeletionConflictResolution"
startMarker="# START DeletionStrategy"
endMarker="# END DeletionStrategy"
language="py"
/>
</TabItem>
Expand All @@ -89,7 +93,6 @@ You can optionally set a collection option on how to resolve object deletion con
```

</TabItem>

</Tabs>

## How to use: Queries
Expand Down
4 changes: 2 additions & 2 deletions developers/weaviate/manage-data/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ You can optionally set a collection option on how to resolve object deletion con
<TabItem value="py" label="Python Client v4">
<FilteredTextBlock
text={PyCode}
startMarker="# START ObjectDeletionConflictResolution"
endMarker="# END ObjectDeletionConflictResolution"
startMarker="# START DeletionStrategy"
endMarker="# END DeletionStrategy"
language="py"
/>
</TabItem>
Expand Down

0 comments on commit 4301cb8

Please sign in to comment.