diff --git a/pages/advanced-algorithms/available-algorithms.mdx b/pages/advanced-algorithms/available-algorithms.mdx
index c4741566f..326d1a113 100644
--- a/pages/advanced-algorithms/available-algorithms.mdx
+++ b/pages/advanced-algorithms/available-algorithms.mdx
@@ -22,7 +22,7 @@ library](/advanced-algorithms/install-mage).
| [Breadth-first search](/advanced-algorithms/deep-path-traversal#breadth-first-search) | C++ | An algorithm for traversing through a graph starting based on nodes' breadth (distance from the source node). |
| [Weighted shortest path](/advanced-algorithms/deep-path-traversal#weighted-shortest-path) | C++ | The weighted shortest path problem is the problem of finding a path between two nodes in a graph such that the sum of the weights of relationships connecting nodes, or the sum of the weight of some node property on the path, is minimized. |
| [All shortest paths](/advanced-algorithms/deep-path-traversal#all-shortest-paths) | C++ | Finding all shortest paths is an expansion of the weighted shortest paths problem. The goal of finding the shortest path is obtaining any minimum sum of weights on the path from one node to the other. |
-| [K shortest paths](/advanced-algorithms/deep-path-traversal#k-shortest-paths) | C++ | Returning K shortest paths between 2 nodes in order of shortest to longest paths. |
+| [K shortest paths](/advanced-algorithms/deep-path-traversal#k-shortest-paths) | C++ | Returning K shortest paths between 2 nodes, ordered by the number of hops or by total weight. |
## Traditional graph algorithms
diff --git a/pages/advanced-algorithms/available-algorithms/cross_database.mdx b/pages/advanced-algorithms/available-algorithms/cross_database.mdx
index ecaff3b14..d7c35d0dc 100644
--- a/pages/advanced-algorithms/available-algorithms/cross_database.mdx
+++ b/pages/advanced-algorithms/available-algorithms/cross_database.mdx
@@ -357,13 +357,19 @@ Read a CSV file directly from AWS S3 and stream its rows into Memgraph.
{
Input:
}
- `file_path: str` ➡ S3 path in the form `s3://bucket-name/path/to/file.csv`.
-- `config: mgp.Map` ➡ AWS credentials; all keys optional. Missing keys fall back to the corresponding
- environment variables:
+- `config: mgp.Map` ➡ AWS credentials and the bucket owner check; all keys optional. Missing
+ credentials fall back to the corresponding environment variables:
- `aws_access_key_id` (env: `AWS_ACCESS_KEY_ID`)
- `aws_secret_access_key` (env: `AWS_SECRET_ACCESS_KEY`)
- `region_name` (env: `AWS_REGION`)
- `aws_session_token` (env: `AWS_SESSION_TOKEN`)
-- `config_path: str` (optional) ➡ Path to a JSON file with AWS credentials.
+ - `bucket_owner` (no environment variable) ➡ The 12-digit AWS account ID that must own the
+ bucket. If another account owns it, S3 refuses the read and the procedure fails. Pass it as a
+ string, such as `'012345678901'`, so leading zeros are kept. A value that isn't 12 digits fails
+ with `Invalid 'bucket_owner'. Expected a 12-digit AWS account ID.` Without `bucket_owner`, the
+ bucket's owner isn't checked.
+- `config_path: str` (optional) ➡ Path to a JSON file with the same keys as `config`. Its values
+ override those in `config`.
{ Output:
}
@@ -379,6 +385,16 @@ YIELD row
CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
```
+To read the file only if the bucket belongs to a given AWS account, add `bucket_owner`. Here the
+credentials come from the environment variables:
+
+```cypher
+CALL cross_database.s3('s3://my-bucket/employees.csv', {region_name: 'eu-central-1',
+ bucket_owner: '123456789012'})
+YIELD row
+CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
+```
+
---
### `arrow_flight()`
diff --git a/pages/advanced-algorithms/deep-path-traversal.mdx b/pages/advanced-algorithms/deep-path-traversal.mdx
index b5daea1fb..01d8fb128 100644
--- a/pages/advanced-algorithms/deep-path-traversal.mdx
+++ b/pages/advanced-algorithms/deep-path-traversal.mdx
@@ -799,8 +799,9 @@ was reached.
## K shortest paths
-The K shortest paths algorithm finds K shortest paths between two nodes in order
-of increasing length. This algorithm is useful when you need to find alternative
+The K shortest paths algorithm finds K shortest paths between two nodes, ordered
+by the number of hops or, with a [weight lambda](#order-paths-by-weight), by
+total weight. This algorithm is useful when you need to find alternative
routes or analyze path diversity in a graph.
### Syntax
@@ -852,6 +853,21 @@ so guard an optional property with `coalesce` as above - a `null` limit raises a
error. A limit of `0` returns no paths for that pair without searching, and a
negative limit raises an error.
+Every part after `*KSHORTEST` is optional, and the parts come in this order:
+
+```plaintext
+*KSHORTEST [MIN_HOPS..MAX_HOPS] [|K] [(r, n | WEIGHT) [TOTAL_WEIGHT] [(r, n | FILTER)]]
+```
+
+- `MIN_HOPS..MAX_HOPS`: the range of path lengths, in hops. Either end can be
+ left out.
+- `|K`: the maximum number of paths for each source-target pair.
+- `(r, n | WEIGHT)`: the weight lambda, which [orders the paths by
+ weight](#order-paths-by-weight).
+- `TOTAL_WEIGHT`: a variable that holds each path's total weight.
+- `(r, n | FILTER)`: the filter lambda, which decides which relationships and
+ nodes the search can expand to. It comes after the weight lambda.
+
### Example
@@ -907,36 +923,208 @@ A negative minimum depth and a maximum depth below 1 both raise an error. A rang
whose minimum exceeds its maximum, such as `4..3`, is empty and returns no paths
without searching.
-### Constraining the expansion based on property values
+### Order paths by weight
+
+To rank paths by cost instead of by the number of hops, add a weight lambda after
+`*KSHORTEST`. Memgraph returns the cheapest path first, and of two paths with
+the same total weight, the one with fewer hops first. Available since Memgraph
+3.15.
+
+In the weight lambda `(r, n | expression)`, `r` is a relationship and `n` is the
+node it leads to, in the direction the pattern is written. A path's total
+weight is the sum of the lambda over the path's relationships, so the first
+node of the path adds no weight.
+
+To return the total weight, add a variable after the lambda. The following
+dataset is the one from the [example](#example), with a `weight` property on
+each relationship:
+
+```cypher
+MATCH (n) DETACH DELETE n;
+CREATE (n1:Node {name: "A"}), (n2:Node {name: "B"}), (n3:Node {name: "C"}), (n4:Node {name: "D"}), (n5:Node {name: "E"}),
+ (n1)-[:ConnectedTo {weight: 1}]->(n2), (n1)-[:ConnectedTo {weight: 10}]->(n3), (n2)-[:ConnectedTo {weight: 2}]->(n3),
+ (n2)-[:ConnectedTo {weight: 1}]->(n4), (n4)-[:ConnectedTo {weight: 1}]->(n3), (n3)-[:ConnectedTo {weight: 1}]->(n5);
+```
+
+The following query returns the paths from `A` to `E` ordered by the sum of
+their `weight` properties:
+
+```cypher
+MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
+WITH a, e
+MATCH path=(a)-[*KSHORTEST (r, n | r.weight) total_weight]->(e)
+RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
+```
+
+```plaintext copy=false
++---------------------------+---------------------------+
+| nodes | total_weight |
++---------------------------+---------------------------+
+| ["A", "B", "C", "E"] | 4 |
+| ["A", "B", "D", "C", "E"] | 4 |
+| ["A", "C", "E"] | 11 |
++---------------------------+---------------------------+
+```
+
+The path through `C` alone has the fewest hops, but it costs 11, so it comes
+last. The other two paths both cost 4, and the one with fewer hops comes first.
+
+The weight lambda works with the path limit and the length range. A maximum
+length leaves out longer paths even when they're cheaper:
+
+```cypher
+MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
+WITH a, e
+MATCH path=(a)-[*KSHORTEST ..3 (r, n | r.weight) total_weight]->(e)
+RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
+```
+
+```plaintext copy=false
++----------------------+----------------------+
+| nodes | total_weight |
++----------------------+----------------------+
+| ["A", "B", "C", "E"] | 4 |
+| ["A", "C", "E"] | 11 |
++----------------------+----------------------+
+```
+
+Each weight must be a non-negative number or a
+[duration](/fundamentals/data-types#duration), and all weights in a search must
+be of the same kind. Otherwise, the query fails:
+
+- **Negative weight**, such as `-1`: `Weight must be non-negative, got -1.`
+- **`null` weight**, for example from a missing property: the error starts with
+ `The weight lambda of a KSHORTEST path expansion must not evaluate to null.`
+- **`NaN` weight:** `The weight lambda of a KSHORTEST path expansion must not
+ evaluate to NaN.`
+- **Boolean weight:** see the breaking change in the next section.
+- **Any other type**, such as a string: `Weight must be numeric or a Duration,
+ got string.`
+- **Numbers and durations mixed:** the error starts with `All weights should be
+ of the same type, either numeric or a Duration.`
+- **Integer total weight above the 64-bit maximum:** `The total weight of a
+ KSHORTEST path overflows a 64-bit integer.`
+
+Before the search, Memgraph evaluates the weight lambda on every relationship
+that leads to the target node, directly or through other nodes and allowed by
+the pattern's relationship types, direction and filter. That includes
+relationships that no path from the source uses.
+
+One such relationship without a valid weight makes the query fail. Give those
+relationships a default with the `coalesce()` function, or leave them out with
+a filter lambda, described in the next section:
+
+```cypher
+MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
+WITH a, e
+MATCH path=(a)-[*KSHORTEST (r, n | coalesce(r.weight, 1)) total_weight]->(e)
+RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
+```
+
+```plaintext copy=false
++---------------------------+---------------------------+
+| nodes | total_weight |
++---------------------------+---------------------------+
+| ["A", "B", "C", "E"] | 4 |
+| ["A", "B", "D", "C", "E"] | 4 |
+| ["A", "C", "E"] | 11 |
++---------------------------+---------------------------+
+```
+
+For the same reason, a weighted search does more work than a hop-count search,
+in proportion to the part of the graph that can reach the target.
+
+A literal or parameter weight, such as `(r, n | 1)` or `(r, n | $cost)`, orders
+paths by the number of hops, as `*KSHORTEST` without a lambda does, and runs
+the same hop-count search. The total weight is then the constant multiplied by
+the number of hops.
+
+### Constraining the expansion based on property values [#k-shortest-paths-filter]
K shortest paths expansion allows an arbitrary expression filter that determines
if an expansion is allowed over a certain relationship to a certain node. The
-filter is defined as a lambda function over `r` and `n`, which denotes the
-relationship expanded over and the node expanded to. The paths returned are the
-K shortest paths of the subgraph the filter leaves behind.
+filter is a second lambda over `r` and `n`, which denote the relationship
+expanded over and the node expanded to.
+
+The filter comes after the [weight lambda](#order-paths-by-weight) and the
+optional total weight variable. The paths returned are the K shortest paths of
+the subgraph the filter leaves behind.
-Using the dataset above, the following example allows expansion only to nodes
-other than `B`, which leaves a single path from `A` to `E`:
+To filter without weighting the paths, use the constant weight `(r, n | 1)`,
+which keeps the hop-count order. Using the dataset above, the following example
+allows expansion only to nodes other than `B`, which leaves a single path from
+`A` to `E`:
```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
-MATCH path=(a)-[*KSHORTEST (r, n | n.name <> "B")]->(e)
+MATCH path=(a)-[*KSHORTEST (r, n | 1) (r, n | n.name <> "B")]->(e)
RETURN path;
```
+```plaintext copy=false
++----------------------------------------------------------------------------------------------------------------------+
+| path |
++----------------------------------------------------------------------------------------------------------------------+
+| (:Node {name: "A"})-[:ConnectedTo {weight: 10}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
++----------------------------------------------------------------------------------------------------------------------+
+```
+
+
+**Breaking change in Memgraph 3.15**: a single lambda after `*KSHORTEST` is now
+the weight lambda, not the filter. Rewrite a filter `(r, n | )` from
+Memgraph 3.13 or 3.14 as `(r, n | 1) (r, n | )`.
+
+
+A filter in the old form raises an error instead of returning different paths:
+
+- **A comparison or other boolean expression**, such as
+ `(r, n | n.name <> "B")`: fails when the query is parsed.
+- **A lambda that returns a boolean or `null` at run time**, such as
+ `(r, n | r.active)`: fails when the query runs.
+
+Both errors include the hint `KSHORTEST takes the weight lambda first. To
+filter without a weight, write (e, n | 1) (e, n | ).`
+
The filter can be combined with the path limit and the length constraints:
```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
-MATCH path=(a)-[*KSHORTEST 2..4 |3 (r, n | n.name <> "D")]->(e)
+MATCH path=(a)-[*KSHORTEST 2..4 |3 (r, n | 1) (r, n | n.name <> "D")]->(e)
RETURN path;
```
-Unlike the other deep path traversal algorithms, K shortest paths does not
-support the three-argument `(r, n, p | ...)` form that exposes the already
-collected path. Using it raises an error.
+```plaintext copy=false
++---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| path |
++---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| (:Node {name: "A"})-[:ConnectedTo {weight: 10}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
+| (:Node {name: "A"})-[:ConnectedTo {weight: 1}]->(:Node {name: "B"})-[:ConnectedTo {weight: 2}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
++---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+```
+
+To filter and order by weight at the same time, put the weight lambda and the
+total weight variable before the filter:
+
+```cypher
+MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
+WITH a, e
+MATCH path=(a)-[*KSHORTEST (r, n | r.weight) total_weight (r, n | n.name <> "D")]->(e)
+RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
+```
+
+```plaintext copy=false
++----------------------+----------------------+
+| nodes | total_weight |
++----------------------+----------------------+
+| ["A", "B", "C", "E"] | 4 |
+| ["A", "C", "E"] | 11 |
++----------------------+----------------------+
+```
+
+Neither lambda takes the accumulated path: the `(r, n, p | ...)` and
+`(r, n, p, w | ...)` forms raise an error.
### When to use K shortest paths?
@@ -949,19 +1137,23 @@ Use the K shortest paths algorithm when you need to:
### Interaction with other systems
- **Fine-grained access control**: Supports enterprise access control features
-- **Hops limit**: Supports query level hops limit
+- **Hops limit**: Supports query level hops limit. If the limit runs out during
+ the search for a source-target pair and [partial
+ results](#controlling-partial-results) are on (the default), that pair
+ returns only the paths the search has proven to be its shortest (or
+ cheapest, with a weight lambda), in order. That can be fewer than `K` paths,
+ or none. A weighted search uses more of the limit, because it also reads the
+ relationships that lead to the target
### Important limitations
- **Predefined nodes**: Both source and target nodes must be matched first using
a `WITH` clause
-- **Unweighted**: Paths are ordered by the number of hops. Relationship
- properties are never treated as weights, and no weight lambda is accepted
-- **No accumulated path in the filter lambda**: the two-argument
- `(r, n | ...)` filter is supported, the three-argument `(r, n, p | ...)` form
- is not
+- **No accumulated path or weight in the lambdas**: the weight and filter
+ lambdas take `(r, n | ...)`; the `(r, n, p | ...)` and `(r, n, p, w | ...)`
+ forms raise an error
- **Filter results**: the filter must evaluate to a boolean or `null`. `null`
prunes the expansion, as `false` does; any other type raises an error
-
\ No newline at end of file
+
diff --git a/pages/database-management/authentication-and-authorization/auth-system-integrations.mdx b/pages/database-management/authentication-and-authorization/auth-system-integrations.mdx
index 7d3f443d8..cc36561be 100644
--- a/pages/database-management/authentication-and-authorization/auth-system-integrations.mdx
+++ b/pages/database-management/authentication-and-authorization/auth-system-integrations.mdx
@@ -33,6 +33,20 @@ associated with a user and Memgraph matches these to existing roles.
As of v3.5, Memgraph supports assigning **multiple roles per user**, meaning an
external auth module can return a single role or a list of roles.
+The name `memgraph_internal` is reserved for the [internal system
+user](/database-management/authentication-and-authorization/users#internal-system-user).
+If a module returns it as the username or as one of the roles, in any letter
+case, Memgraph refuses the login and logs a warning, on data instances and
+coordinators alike, whether or not `--system-user-internal-hash-file` is set.
+Before Memgraph 3.15, the name wasn't reserved.
+
+Memgraph also checks the name at startup. If a user or role named
+`memgraph_internal`, created before Memgraph 3.15, exists and
+`--system-user-internal-hash-file` is set, Memgraph refuses to start. If the
+flag isn't set, Memgraph starts and logs a warning. Rename the user or role as
+described in the [3.15 upgrade
+guide](/database-management/upgrades/specific-versions#v315---reserved-memgraph_internal-name).
+
### Configuration flags
diff --git a/pages/database-management/authentication-and-authorization/multiple-roles.mdx b/pages/database-management/authentication-and-authorization/multiple-roles.mdx
index 92ba1c052..90f0575f8 100644
--- a/pages/database-management/authentication-and-authorization/multiple-roles.mdx
+++ b/pages/database-management/authentication-and-authorization/multiple-roles.mdx
@@ -43,12 +43,12 @@ if the user also has access to the database.
In Memgraph Enterprise, both users and roles can have database access
permissions:
-```cypher
+```cypher template
// Grant database access to a role
GRANT DATABASE db_name TO user_or_role;
// Deny database access
-DENY DATABASE db_name FROM user_or_role;
+DENY DATABASE db_name TO user_or_role;
// Revoke database access
REVOKE DATABASE db_name FROM user_or_role;
@@ -94,7 +94,7 @@ When roles have conflicting database access, deny takes precedence:
GRANT DATABASE db1 TO role1;
// Role2 denies access to db1
-DENY DATABASE db1 FROM role2;
+DENY DATABASE db1 TO role2;
// User with both roles
SET ROLE FOR user TO role1, role2;
diff --git a/pages/database-management/authentication-and-authorization/query-privileges.mdx b/pages/database-management/authentication-and-authorization/query-privileges.mdx
index 8c6fbf41f..edb7005f9 100644
--- a/pages/database-management/authentication-and-authorization/query-privileges.mdx
+++ b/pages/database-management/authentication-and-authorization/query-privileges.mdx
@@ -85,7 +85,7 @@ Memgraph's privilege system controls access to various database operations throu
| `SHOW ROLE FOR USER` | `AUTH` | |
| `SHOW USERS FOR ROLE` | `AUTH` | |
| `GRANT DATABASE TO USER` | `AUTH` | |
-| `DENY DATABASE FROM USER` | `AUTH` | |
+| `DENY DATABASE TO USER` | `AUTH` | |
| `REVOKE DATABASE FROM USER` | `AUTH` | |
| `SHOW DATABASE PRIVILEGES` | `AUTH` | |
| `SET MAIN DATABASE` | `AUTH` | |
diff --git a/pages/database-management/authentication-and-authorization/role-based-access-control.mdx b/pages/database-management/authentication-and-authorization/role-based-access-control.mdx
index 4c12243a1..9ba88b9aa 100644
--- a/pages/database-management/authentication-and-authorization/role-based-access-control.mdx
+++ b/pages/database-management/authentication-and-authorization/role-based-access-control.mdx
@@ -1011,6 +1011,43 @@ Revoking property permissions on relationships:
REVOKE READ {start_date} ON EDGES OF TYPE :WORKS_AT FROM charlie;
```
+#### Wildcard and named properties in one rule
+
+A property rule is one label list with its `MATCHING` mode, or one edge type.
+In a rule, `{*}` and each named property are separate entries:
+
+- `GRANT`, `DENY` and `REVOKE` on `{*}` change only the `{*}` entry. Named
+ properties in the same rule keep their grants and denies.
+- A named property's entry decides each privilege it grants or denies for
+ that property. `{*}` applies to the rest. For example, with
+ `GRANT SET PROPERTY {ssn}` and `DENY READ {*}`, reading `ssn` is still
+ denied.
+- To remove a named property's entry, revoke it by name. `REVOKE {*}` leaves
+ it in place.
+
+For example, these two statements let `charlie` read every property of
+`:Employee` nodes except `ssn`, in whichever order they run:
+
+```cypher
+GRANT READ {*} ON NODES CONTAINING LABELS :Employee TO charlie;
+DENY READ {ssn} ON NODES CONTAINING LABELS :Employee TO charlie;
+```
+
+Revoking the wildcard removes only the `{*}` entry, so the deny on `ssn` stays
+in place:
+
+```cypher
+REVOKE READ {*} ON NODES CONTAINING LABELS :Employee FROM charlie;
+```
+
+`SHOW PRIVILEGES` lists the `{*}` entry and the named entries of a rule. Entries
+with the same effect share a row, such as `READ {*, salary}`.
+
+The global rules (`ON NODES CONTAINING LABELS *` and `ON EDGES OF TYPE *`) treat
+`{*}` the same way. Before Memgraph 3.15, `GRANT {*}` on a label or edge-type
+rule removed the named grants in that rule, `DENY {*}` removed the named denies,
+and `REVOKE {*}` removed every named property too.
+
#### How denied properties behave
When a user does not have `READ` permission on a property, the property value is
@@ -1049,8 +1086,8 @@ Global property permissions (granted on `{*}`) act as a per-property fallback.
For each property access check, the resolution order is:
1. Check all entity-specific rules that match the node's labels (or the edge's
-type). If any matching rule covers the property being checked (either by name
-or via `{*}` within that rule), use that result.
+type). If any matching rule covers the property being checked (by name, or
+otherwise via `{*}` within that rule), use that result.
2. If no matching rule covers the property, fall through to the global rules.
This means that having a property rule on `:Employee` for one property (e.g.
diff --git a/pages/database-management/authentication-and-authorization/users.mdx b/pages/database-management/authentication-and-authorization/users.mdx
index 197d43c80..ee67388c5 100644
--- a/pages/database-management/authentication-and-authorization/users.mdx
+++ b/pages/database-management/authentication-and-authorization/users.mdx
@@ -89,9 +89,39 @@ Supported algorithms:
1. "bcrypt"
1. "sha256"
1. "sha256-multiple"
+1. "pbkdf2-sha256"
Hash is the alphanumerical string of 64 characters for sha256 and 60 characters for bcrypt;
+A pbkdf2-sha256 hash also names its iteration count and salt:
+`pbkdf2-sha256:600000::`, where the salt is 16 bytes and the
+derived key 32 bytes, both in lowercase hex. Memgraph accepts only its own
+600000 iterations. Both `CREATE USER ... IDENTIFIED BY` and `SET PASSWORD`
+accept pre-hashed passwords. Pre-hashed pbkdf2-sha256 passwords are available
+since Memgraph 3.15.
+
+Example where "alice" is identified by "alice-pass":
+
+```cypher
+CREATE USER alice IDENTIFIED BY 'pbkdf2-sha256:600000:101112131415161718191a1b1c1d1e1f:df34d3ed941c484a51e2e89df8f10b23f452c5fa38ff4f5a049689c1b1dae2f6';
+```
+
+A password that starts with an algorithm name and a colon (`bcrypt:`,
+`sha256:`, `sha256-multiple:` or `pbkdf2-sha256:`, in any letter case) but isn't a
+valid hash is refused:
+
+```cypher invalid
+CREATE USER bob IDENTIFIED BY 'sha256:abc';
+```
+
+```plaintext copy=false
+The password starts like a pre-hashed sha256 password but isn't a valid one. It must be "sha256:" followed by the 64-character hash.
+```
+
+Before Memgraph 3.15, Memgraph accepted such a password as plaintext: the
+password was the whole string, such as `sha256:abc`. Users created that way
+still log in with that string.
+
To delete a user, run the following command:
```cypher
@@ -224,6 +254,99 @@ Example:
+## Internal system user
+
+The internal system user, `memgraph_internal`, is a login for cluster
+automation such as a Kubernetes operator. It works on data instances and
+coordinators whether or not other users, roles or
+[SSO](/database-management/authentication-and-authorization/auth-system-integrations#single-sign-on)
+exist, and logging in doesn't require an Enterprise license. Available since
+Memgraph 3.15.
+
+### Enable the internal system user
+
+1. Write the user's password hash to a file, as a single bcrypt
+ (`bcrypt:$2a$...`) or pbkdf2-sha256
+ (`pbkdf2-sha256:600000::`) hash of a non-empty password, the
+ same forms as a [pre-hashed password](#administer-users). This command
+ prompts for the password and writes its pbkdf2-sha256 hash to
+ `internal.hash`:
+
+ ```bash
+ python3 -c 'import getpass, hashlib, os; salt = os.urandom(16); key = hashlib.pbkdf2_hmac("sha256", getpass.getpass().encode(), salt, 600000, 32); print(f"pbkdf2-sha256:600000:{salt.hex()}:{key.hex()}")' > internal.hash
+ ```
+
+2. Start Memgraph with `--system-user-internal-hash-file` set to that file:
+
+ ```bash
+ docker run -p 7687:7687 \
+ -v "$(pwd)/internal.hash:/etc/memgraph/internal.hash:ro" \
+ memgraph/memgraph --system-user-internal-hash-file=/etc/memgraph/internal.hash
+ ```
+
+3. Log in with the username `memgraph_internal` and the password.
+
+Memgraph reads the file once, at startup. It refuses to start if the file
+can't be read or holds anything else, and under `--fips-mode` if it holds a
+bcrypt hash: FIPS mode only accepts pbkdf2-sha256. If the flag is empty (the
+default), the internal system user doesn't exist.
+
+### What the internal system user can do
+
+- **Data instances:** the session has every privilege, and
+ [fine-grained access
+ control](/database-management/authentication-and-authorization/role-based-access-control#fine-grained-access-control)
+ doesn't apply to it.
+- **Coordinators:** the session has `COORDINATOR_READ` and `COORDINATOR_WRITE`,
+ whatever coordinator roles exist (see [coordinator
+ privileges](/database-management/clustering/high-availability/coordinator-authentication#coordinator-privileges)).
+- **Wrong password:** the login is refused, also on a coordinator that admits
+ other users through [authentication
+ passthrough](/database-management/clustering/high-availability/coordinator-authentication#authentication-passthrough).
+
+`SHOW CURRENT USER`, `SHOW SESSIONS` and the query logs name the session
+`memgraph_internal`. The user isn't stored, so `SHOW USERS` doesn't list it,
+and no query can create, change, grant to or drop it.
+
+The internal system user can't own a `SECURITY DEFINER`
+[trigger](/fundamentals/triggers), which is the default for `CREATE TRIGGER`,
+or a [stream](/data-migration/data-streams), because both run as an owner
+stored by name. Create triggers with `SECURITY INVOKER`, or create triggers and
+streams as a named user:
+
+```plaintext copy=false
+The internal system user can't own a SECURITY DEFINER trigger. Create it with SECURITY INVOKER, or as a named user.
+```
+
+### Reserved name
+
+The name `memgraph_internal` is reserved, in any letter case, even when
+`--system-user-internal-hash-file` is empty:
+
+- `CREATE USER` and `CREATE ROLE` refuse it, also with `IF NOT EXISTS`, on data
+ instances and coordinators.
+- An auth module (LDAP, SSO) that returns it as the username or as one of the
+ roles has its login refused.
+- A user or role named `memgraph_internal` created before Memgraph 3.15 keeps
+ working while `--system-user-internal-hash-file` is empty, and Memgraph logs
+ a warning at startup. With the flag set, Memgraph refuses to start.
+
+```cypher invalid
+CREATE USER IF NOT EXISTS memgraph_internal;
+```
+
+```plaintext copy=false
+The name 'memgraph_internal' is reserved for the internal system user.
+```
+
+
+**Breaking change in Memgraph 3.15**: a user or role named `memgraph_internal`
+created before Memgraph 3.15 stops Memgraph from starting with
+`--system-user-internal-hash-file` set. Rename it before upgrading, as
+described in the [3.15 upgrade
+guide](/database-management/upgrades/specific-versions#v315---reserved-memgraph_internal-name).
+
+
## Owners
The privileges of the owners of [streams](/data-migration/data-streams) and
diff --git a/pages/database-management/clustering/faq.mdx b/pages/database-management/clustering/faq.mdx
index 274f259b2..3ca66039d 100644
--- a/pages/database-management/clustering/faq.mdx
+++ b/pages/database-management/clustering/faq.mdx
@@ -76,8 +76,9 @@ For achieving no data loss, users should use the STRICT_SYNC replication mode, w
protocol during the commit stage.
#### Which replication mode should I use for achieving maximum performance?
-For achieving maximum performance, users should use the ASYNC replication mode, which is using a background thread to replicate
-data. This mode is eventually consistent, but the MAIN instance does not wait for the REPLICAs to commit their changes.
+For achieving maximum performance, users should use the ASYNC replication mode. The MAIN instance commits without waiting for ASYNC
+REPLICAs, which catch up from durability files in rounds, about every 11 seconds by default (see [ASYNC replication
+mode](/database-management/clustering/replication/how-replication-works#async-replication-mode)). This mode is eventually consistent.
#### Which replication mode should I use for cross datacenter deployment?
This again depends on whether you're okay with data loss, or eventual consistency:
diff --git a/pages/database-management/clustering/high-availability/best-practices.mdx b/pages/database-management/clustering/high-availability/best-practices.mdx
index 566e2b85e..accd8af34 100644
--- a/pages/database-management/clustering/high-availability/best-practices.mdx
+++ b/pages/database-management/clustering/high-availability/best-practices.mdx
@@ -55,6 +55,15 @@ instance with `--storage-wal-enabled=false`
**Example:** `--storage-wal-enabled=true`
+#### Per-database flags
+
+Run every data instance with the same per-database flags, such as
+`--schema-info-enabled` and `--storage-properties-on-edges`. Each instance
+applies its own values to every database it holds, so a database behaves
+differently on an instance whose flags differ, including after a failover
+makes that instance MAIN. For the full list, see [per-database
+flags](/database-management/clustering/replication/best-practices#per-database-flags).
+
---
### Coordinator flags
diff --git a/pages/database-management/clustering/high-availability/coordinator-authentication.mdx b/pages/database-management/clustering/high-availability/coordinator-authentication.mdx
index c71e3c55e..153c88d62 100644
--- a/pages/database-management/clustering/high-availability/coordinator-authentication.mdx
+++ b/pages/database-management/clustering/high-availability/coordinator-authentication.mdx
@@ -121,6 +121,9 @@ authentication scheme the client sends:
in `--auth-module-mappings` — takes the [passthrough
path](#authentication-passthrough) described next.
+A connection with an empty authentication scheme is refused. Before Memgraph
+3.15, it took the passthrough path.
+
There is no separate "unsupported scheme" rule. A client that keeps its
data-instance SSO configuration (for example, `oidc`) when talking to a
coordinator that has no SSO configured is treated exactly like a basic-auth
@@ -134,6 +137,14 @@ auth at all, or with any scheme not listed in `--auth-module-mappings`
`COORDINATOR_WRITE` access. This is the pre-3.13 behavior, it requires no
license, and it keeps existing admin tooling working unchanged.
+The [internal system
+user](/database-management/authentication-and-authorization/users#internal-system-user)
+is the exception. On a coordinator started with
+`--system-user-internal-hash-file`, a `basic` or `none` login with the username
+`memgraph_internal` is checked against its password, whether or not SSO is
+configured. With the right password, the session gets `COORDINATOR_READ` and
+`COORDINATOR_WRITE`; with a wrong one, the login is refused.
+
**Memgraph 3.13 rejected unlisted schemes.** In 3.13, a coordinator only let
`basic`/`none` through and refused any other scheme outright, so drivers that
diff --git a/pages/database-management/clustering/high-availability/how-high-availability-works.mdx b/pages/database-management/clustering/high-availability/how-high-availability-works.mdx
index 26d84b9e9..05461e74f 100644
--- a/pages/database-management/clustering/high-availability/how-high-availability-works.mdx
+++ b/pages/database-management/clustering/high-availability/how-high-availability-works.mdx
@@ -618,6 +618,10 @@ replication mode:
- Similar to `SYNC`, but with an even higher chance of data loss because the
MAIN continues committing freely regardless of replica status.
+- An `ASYNC` replica receives data in recovery rounds spaced by
+ `--replication-async-recovery-interval-sec` (10 seconds by default), so a
+ failover to it loses the writes since its last round. See [ASYNC replication
+ mode](/database-management/clustering/replication/how-replication-works#async-replication-mode).
{ STRICT_SYNC
}
diff --git a/pages/database-management/clustering/replication/best-practices.mdx b/pages/database-management/clustering/replication/best-practices.mdx
index a81be3169..fd2deb6fc 100644
--- a/pages/database-management/clustering/replication/best-practices.mdx
+++ b/pages/database-management/clustering/replication/best-practices.mdx
@@ -154,6 +154,31 @@ resolved by users.
default. If you change the value for the flag, change it for all the respective
instances accordingly.
+### Per-database flags
+
+Run MAIN and every REPLICA with the same values of the flags that configure a
+database:
+
+- `--schema-info-enabled`
+- `--storage-properties-on-edges`
+- `--storage-light-edge`
+- `--storage-enable-edges-metadata`
+- `--storage-enable-schema-metadata`
+- `--storage-automatic-label-index-creation-enabled`
+- `--storage-automatic-edge-type-index-creation-enabled`
+- `--storage-delta-on-identical-property-update`
+- `--storage-property-store-compression-enabled`
+- `--storage-property-store-compression-level`
+
+Each instance applies its own values of these flags to every database it
+holds, including the databases it receives from MAIN. A database on an
+instance with different values behaves differently there: for example,
+`SHOW SCHEMA INFO` works on a REPLICA's databases only if the REPLICA runs
+with `--schema-info-enabled=true`. The [configuration
+page](/database-management/configuration) describes each flag.
+
+**Advice:** If you change one of these flags, change it on every instance.
+
## Permissions to run replication queries
diff --git a/pages/database-management/clustering/replication/how-replication-works.mdx b/pages/database-management/clustering/replication/how-replication-works.mdx
index 137417b68..9bc1fb010 100644
--- a/pages/database-management/clustering/replication/how-replication-works.mdx
+++ b/pages/database-management/clustering/replication/how-replication-works.mdx
@@ -172,33 +172,49 @@ of replicas.
### ASYNC replication mode
-In the ASYNC replication mode, the MAIN instance will commit a transaction
-without receiving confirmation from REPLICA instances that they have received
-the same transaction. This means that the **MAIN instance does not wait for the
-response from the REPLICA instances** in the main thread but in some other thread.
-
-For each registered REPLICA, the MAIN instance keeps a permanent background
-worker that carries the commit-path work for that replica: it encodes the
-transaction, ships it, and receives the confirmation of successful replication.
-In ASYNC mode the commit thread does not wait for that worker, so confirmations
-are handled entirely off the main storage thread. A second per-replica worker
-runs the periodic state checks and recovery, so a long recovery cannot delay
-replication of new transactions. See [parallel WAL writes and delta
-shipping](#parallel-wal-writes-and-delta-shipping) for how the commit-path
-workers overlap with the MAIN instance's own WAL write.
+In the ASYNC replication mode, the MAIN instance commits a transaction without
+sending it to ASYNC REPLICAs and without waiting for them. After each commit,
+MAIN marks every ASYNC REPLICA as behind, and the periodic replica check catches
+it up from durability files: the snapshot and WAL files the REPLICA is missing,
+and MAIN's current WAL file. This is the same
+[recovery](#instance-synchronization) that brings any REPLICA back in sync after
+an outage.
+
+Recovery runs in rounds. MAIN checks each REPLICA every
+`--replication-replica-check-frequency-sec` seconds (1 by default), and a check
+that finds an ASYNC REPLICA behind starts a round once
+`--replication-async-recovery-interval-sec` seconds (10 by default) have passed
+since its previous round ended. Under constant writes, data reaches an ASYNC
+REPLICA in bursts about 11 seconds apart with the defaults, not transaction by
+transaction. Before Memgraph 3.15, MAIN sent each transaction to ASYNC REPLICAs
+as it committed.
+
+This affects how you run ASYNC REPLICAs:
+
+- **Failover:** promoting an ASYNC REPLICA to MAIN loses the writes since its
+ last round, up to about the interval plus one check. To shrink this window, lower
+ `--replication-async-recovery-interval-sec`; MAIN then re-sends its current
+ WAL file more often. With `0`, a round starts at every check that finds the
+ REPLICA behind.
+- **Monitoring:** under constant writes, `SHOW REPLICAS` shows a healthy ASYNC
+ REPLICA as `invalid` most of the time (see [REPLICA states](#replica-states)).
**ASYNC mode ensures system availability and partition tolerance (AP).**
-
-
## REPLICA states
There are 5 states in which replica can be at a point in time:
- **READY** - replica is not lagging behind and all the data is replicated
-- **REPLICATING** - state the REPLICA is in when it's receiving transaction
-commits. If this action succeeds, the replica will again move to READY state. If
-it fails, it will move to INVALID.
-- **INVALID/BEHIND** - replica is behind, and needs to be synced with MAIN
+- **REPLICATING** - state a SYNC or STRICT_SYNC REPLICA is in when it's
+receiving transaction commits. If this action succeeds, the replica will again
+move to READY state. If it fails, it will move to INVALID.
+- **INVALID/BEHIND** - replica may be behind, and the next replica check syncs
+it with MAIN. `SHOW REPLICAS` shows this state as `invalid`. An ASYNC REPLICA
+enters it after every commit on MAIN, so under constant writes a healthy ASYNC
+REPLICA is `invalid` most of the time and `ready` only between the end of a
+recovery round and the next commit. For an ASYNC REPLICA, watch its `ts` in
+`SHOW REPLICAS` instead: it advances after each round while the REPLICA keeps
+up.
- **RECOVERY** - after MAIN detects that a REPLICA is invalid/behind, the
REPLICA state is changed to RECOVERY. At this point, the transfer of durability
files is performed in order for the REPLICA to catch up with MAIN
@@ -246,6 +262,9 @@ In that case, REPLICA will transfer from READY to REPLICATING state, and then
come back again to the READY state. Transfer of delta objects in real-time is
the optimal approach, because they're the smallest units to be transferred over
the network. This happy flow ensures the REPLICA is always in-sync with MAIN.
+This flow applies to SYNC and STRICT_SYNC REPLICAs only; ASYNC REPLICAs catch up
+from durability files, as described in [ASYNC replication
+mode](#async-replication-mode).
There are a variety of scenarios when that happy flow can not be maintained,
such as network issues, or failing of the instance. By comparing timestamps, the
@@ -301,6 +320,16 @@ When sending replication data over the network, durability files are also
assigned the database UUID. It serves as a unique location of which database to
apply the durability files to in the replicas.
+A REPLICA creates each database it receives from MAIN with its own
+per-database flags, such as `--schema-info-enabled`, as it does its default
+`memgraph` database. Only the database name and UUID come from MAIN. Run every
+instance with the same [per-database
+flags](/database-management/clustering/replication/best-practices#per-database-flags),
+so each database behaves the same on MAIN and on its REPLICAs. Before Memgraph
+3.15, a REPLICA created these databases with the default values of most
+per-database flags instead of its own, and they changed behavior when the
+REPLICA restarted.
+

@@ -377,7 +406,8 @@ every registered REPLICA. Both happen on the commit path, but they do not happen
one after another.
The commit thread walks the transaction's deltas once and records everything
-that has to be written. It then schedules one task per streaming REPLICA — each
+that has to be written. It then schedules one task per SYNC and STRICT_SYNC
+REPLICA — each
task encodes the whole transaction (metadata deltas first, then data deltas)
into that replica's RPC stream, on that replica's own background worker — and
writes its own WAL inline, at the same time. Encoding for all replicas and the
@@ -407,9 +437,10 @@ Ordering and failure containment are preserved:
The commit thread collects every per-replica task before it publishes the
transaction's commit timestamp, because encoding reads live node and edge state
-that later transactions may overwrite in place. Waiting for a replica's *reply*
-still follows the replica's replication mode: SYNC and STRICT_SYNC block the
-commit, ASYNC does not.
+that later transactions may overwrite in place. SYNC and STRICT_SYNC block the
+commit while they wait for a replica's *reply*. ASYNC REPLICAs aren't on the
+commit path at all: they catch up through recovery, as described in [ASYNC
+replication mode](#async-replication-mode).
### Fixing timestamp consistency
diff --git a/pages/database-management/clustering/replication/replication-commands-reference.mdx b/pages/database-management/clustering/replication/replication-commands-reference.mdx
index 20b10a039..9459568d2 100644
--- a/pages/database-management/clustering/replication/replication-commands-reference.mdx
+++ b/pages/database-management/clustering/replication/replication-commands-reference.mdx
@@ -225,7 +225,10 @@ SHOW REPLICAS;
- network address of the REPLICA + port of the replication server
- replication mode (SYNC/ASYNC/STRICT_SYNC)
- system information
-- tenant information (lag, status, timestamp)
+- tenant information: for each database, `ts` (the REPLICA's timestamp),
+ `behind` (the REPLICA's timestamp minus MAIN's, so 0 or negative) and
+ `status` (see [REPLICA
+ states](/database-management/clustering/replication/how-replication-works#replica-states))
**Example output:**
```nocopy
diff --git a/pages/database-management/clustering/replication/setup-replication-cluster-docker.mdx b/pages/database-management/clustering/replication/setup-replication-cluster-docker.mdx
index 381577047..76c39d16d 100644
--- a/pages/database-management/clustering/replication/setup-replication-cluster-docker.mdx
+++ b/pages/database-management/clustering/replication/setup-replication-cluster-docker.mdx
@@ -192,6 +192,13 @@ By showing replicas, we can see that the timestamp data info for the database `m
Replicas are not behind (`behind` is 0), and they're in a `ready` state. This means data has been
successfully replicated.
+REP1, the SYNC replica, has the write as soon as the query returns. REP2, the
+ASYNC replica, gets it at MAIN's next [recovery
+round](/database-management/clustering/replication/how-replication-works#async-replication-mode),
+so right after the write it can show `status: "invalid"` and a negative
+`behind` for up to about 11 seconds. Run `SHOW REPLICAS` again until it's
+`ready`.
+
```
SHOW REPLICAS;
```
diff --git a/pages/database-management/configuration.mdx b/pages/database-management/configuration.mdx
index 20b0338f5..e24635ca6 100644
--- a/pages/database-management/configuration.mdx
+++ b/pages/database-management/configuration.mdx
@@ -312,31 +312,61 @@ systemctl status memgraph
### Change configuration during runtime
Memgraph contains settings that can be modified during runtime using a Cypher query.
-Some runtime settings are persisted between multiple runs, while others will
-fallback to the value of the command-line argument.
-
-| Setting name | Description | Persistent between runs |
-|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
-| organization.name | Name of the organization using the instance of Memgraph (used for verifying the license key). | yes |
-| enterprise.license | License key for Memgraph Enterprise. | yes |
-| server.name | Bolt server name. | yes |
-| query.timeout | Maximum allowed query execution time. Value of 0 means no limit. | yes |
-| log.level | Minimum log level. Allowed values: TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL. | no |
-| log.to_stderr | Log messages go to `stderr` in addition to `logfiles`. | no |
-| log.min_duration_ms | Log successful queries whose `parse + plan + execute` time (ms) reaches this threshold with a `[slow-query]` tag. `-1` disables; `0` logs every successful query. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). | yes |
-| log.failed_queries | Log each failed query with a `[failed-query]` tag. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). | yes |
-| log.query_plan | Append the query's EXPLAIN plan to its `[slow-query]` log line. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). | yes |
-| cartesian-product-enabled | Enforces cartesian product operator during query matching. | no |
-| hops_limit_partial_results | If set to `true`, partial results are returned when the hops limit is reached. If set to `false`, an exception is thrown when the hops limit is reached. The default value is `true`. | yes |
-| timezone | IANA timezone identifier string setting the instance's timezone. | yes |
-| storage.snapshot.interval | Define periodic snapshot schedule via 6-field cron expression (seconds, minute, hour, day of month, month, day of week—an [Enterprise feature](/database-management/enabling-memgraph-enterprise)) or as a period in seconds. Set to empty string to disable. | no |
-| storage-gc-aggressive | Enables aggressive garbage collection, which performs full cleanup on GC call where deltas, vertices, edges or indices and constraints skip lists are being cleaned up. This setting requires taking a unique lock that will temporarily block the system during garbage collection. | yes |
-| storage.access_timeout_sec | Storage access timeout in seconds. Guards against queries waiting indefinitely for storage access. Valid range: [1, 1000000]. Corresponds to `--storage-access-timeout-sec`. | no |
-| storage.omit_vector_index_properties_on_return | When `true`, properties backed by a vector index (for example embeddings) are omitted when a whole node or relationship is returned; they remain accessible via explicit property access (`n.embedding`, `properties(n)`). Corresponds to `--storage-omit-vector-index-properties-on-return`. | yes |
-| aws.region | AWS region in which your S3 service is located. | yes |
-| aws.access_key | Access key used to READ the file from S3. | yes |
-| aws.secret_key | Secret key used to READ the file from S3. | yes |
-| aws.endpoint_url | URL on which S3 can be accessed (if using some other S3-compatible storage). | yes |
+A value set at runtime lasts until Memgraph restarts. On restart, each setting
+takes the value of its flag, or the flag's default if the flag isn't set. To
+keep a value, set the flag in your configuration.
+
+The exceptions are the license settings (`organization.name`,
+`enterprise.license`) and the AWS settings (`aws.region`, `aws.access_key`,
+`aws.secret_key`, `aws.endpoint_url`), which are stored in the data directory
+and survive a restart. For the AWS settings, a flag set at startup replaces the
+stored value. For the license, see [License sources and
+selection](/database-management/enabling-memgraph-enterprise#license-sources-and-selection).
+
+
+**Breaking change in Memgraph 3.15**: runtime settings no longer survive a
+restart, except the license and AWS settings. To keep a value you set with `SET
+DATABASE SETTING`, add the matching flag to your configuration.
+
+
+Before Memgraph 3.15, `server.name`, `timezone`, `hops_limit_partial_results`,
+`storage-gc-aggressive`, `storage.omit_vector_index_properties_on_return`,
+`file.download_conn_timeout_sec`, `log.min_duration_ms`, `log.failed_queries`
+and `log.query_plan` kept their runtime value when their flag wasn't set. On the
+first start after upgrading, Memgraph applies such a stored value one last time,
+unless the matching flag is set, and then deletes it. From the second start on,
+only the flag applies, for example `--timezone=Europe/Zagreb` or
+`--bolt-server-name-for-init="My Server"`.
+
+You can change the following settings at runtime with `SET DATABASE SETTING`:
+
+| Setting name | Description | Persistent between runs |
+|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
+| organization.name | Name of the organization using the instance of Memgraph (used for verifying the license key). | yes |
+| enterprise.license | License key for Memgraph Enterprise. | yes |
+| server.name | Bolt server name. Corresponds to `--bolt-server-name-for-init`. | no |
+| query.timeout | Maximum allowed query execution time in seconds. Allowed values: 0 to 1000000000; 0 means no limit. Corresponds to `--query-execution-timeout-sec`. | no |
+| log.level | Minimum log level. Allowed values: TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL. Corresponds to `--log-level`. | no |
+| log.to_stderr | Log messages go to `stderr` in addition to `logfiles`. Corresponds to `--also-log-to-stderr`. | no |
+| log.min_duration_ms | Log successful queries whose `parse + plan + execute` time (ms) reaches this threshold with a `[slow-query]` tag. `-1` disables; `0` logs every successful query. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). Corresponds to `--log-min-duration-ms`. | no |
+| log.failed_queries | Log each failed query with a `[failed-query]` tag. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). Corresponds to `--log-failed-queries`. | no |
+| log.query_plan | Append the query's EXPLAIN plan to its `[slow-query]` log line. See [Slow and failed query logging](/database-management/logs#slow-and-failed-query-logging). Corresponds to `--log-query-plan`. | no |
+| cartesian-product-enabled | Enforces cartesian product operator during query matching. Corresponds to `--cartesian-product-enabled`. | no |
+| hops_limit_partial_results | If set to `true`, partial results are returned when the hops limit is reached. If set to `false`, an exception is thrown when the hops limit is reached. The default value is `true`. Corresponds to `--hops-limit-partial-results`. | no |
+| timezone | IANA timezone identifier string setting the instance's timezone. Corresponds to `--timezone`. | no |
+| storage.snapshot.interval | Define periodic snapshot schedule via 6-field cron expression (seconds, minute, hour, day of month, month, day of week—an [Enterprise feature](/database-management/enabling-memgraph-enterprise)) or as a period in seconds. Set to empty string to disable. Corresponds to `--storage-snapshot-interval`. | no |
+| storage-gc-aggressive | Enables aggressive garbage collection, which performs full cleanup on GC call where deltas, vertices, edges or indices and constraints skip lists are being cleaned up. This setting requires taking a unique lock that will temporarily block the system during garbage collection. Corresponds to `--storage-gc-aggressive`. | no |
+| storage.access_timeout_sec | Storage access timeout in seconds. Guards against queries waiting indefinitely for storage access. Valid range: [1, 1000000]. Corresponds to `--storage-access-timeout-sec`. | no |
+| debug-query-plans | Log potential query plans at `DEBUG` level. Corresponds to `--debug-query-plans`. | no |
+| file.download_conn_timeout_sec | Timeout in seconds for establishing a connection to the remote server when downloading a file. Corresponds to `--file-download-conn-timeout-sec`. | no |
+| storage.omit_vector_index_properties_on_return | When `true`, properties backed by a vector index (for example embeddings) are omitted when a whole node or relationship is returned; they remain accessible via explicit property access (`n.embedding`, `properties(n)`). Corresponds to `--storage-omit-vector-index-properties-on-return`. | no |
+| aws.region | AWS region in which your S3 service is located. Corresponds to `--aws-region`. | yes |
+| aws.access_key | Access key used to READ the file from S3. Corresponds to `--aws-access-key`. | yes |
+| aws.secret_key | Secret key used to READ the file from S3. Corresponds to `--aws-secret-key`. | yes |
+| aws.endpoint_url | URL on which S3 can be accessed (if using some other S3-compatible storage). Corresponds to `--aws-endpoint-url`. | yes |
+
+Setting `query.timeout` to a value outside its allowed range fails with
+`Cannot update setting 'query.timeout': Value must be a number in range [0, 1000000000].`
All settings can be fetched by calling the following query:
@@ -398,6 +428,7 @@ auth module authentication and authorization mechanisms used by Memgraph.
| `--auth-password-permit-null` | Can be set to false to disable null passwords. |
| `--auth-password-strength-regex` | The regular expression that should be used to match the entire entered password to ensure its strength. The syntax for regular expressions is derived from a [modified version of the ECMAScript regular expression grammar](https://en.cppreference.com/w/cpp/regex/ecmascript). |
| `--auth-user-or-role-name-regex` | Set to the regular expression that each user or role name must fulfill. The syntax for regular expressions is derived from a [modified version of the ECMAScript regular expression grammar](https://en.cppreference.com/w/cpp/regex/ecmascript). |
+| `--system-user-internal-hash-file` | Path to a file holding the bcrypt or pbkdf2-sha256 password hash of the [internal system user](/database-management/authentication-and-authorization/users#internal-system-user) `memgraph_internal`, the login for cluster automation such as a Kubernetes operator. Empty (the default) means the user doesn't exist. |
### Bolt
@@ -450,7 +481,7 @@ execution in Memgraph.
| `--query-ast-cache-max-size=1000` | Maximum number of parsed query abstract syntax trees to cache.
Value of 0 disables the cache. | `[int32]` |
| `--query-callable-mappings-path=/etc/memgraph/apoc_compatibility_mappings.json` | Path to the JSON file that contains possible alias mappings for query procedures in the form of key-value pairs. | `[string]` |
| `--query-cost-planner=true` | Use the cost-estimating query planner. When enabled (`true`), Memgraph generates multiple query plans, selecting the one with the lowest cost. If disabled (`false`), it creates a single plan that is executed. | `[bool]` |
-| `--query-execution-timeout-sec=600` | Maximum allowed query execution time.
Queries exceeding this limit will be aborted. Value of 0 means no limit. | `[uint64]` |
+| `--query-execution-timeout-sec=600` | Maximum allowed query execution time in seconds.
Queries exceeding this limit will be aborted. Value of 0 means no limit. Allowed values: 0 to 1000000000; Memgraph doesn't start with a value outside this range. | `[double]` |
| `--query-max-plans=1000` | Maximum number of generated plans for a query. | `[uint64]` |
| `--query-modules-directory=/usr/lib/memgraph/query_modules` | Directory where modules with custom query procedures are stored. NOTE: Multiple comma-separated directories can be defined. The flag is ignored on coordinator instances in a [high availability](/database-management/clustering/high-availability) setup. | `[string]` |
| `--query-plan-cache-max-size=1000` | Maximum number of query plans to cache. | `[int32]` |
@@ -574,7 +605,8 @@ This section contains the list of all other relevant flags used within Memgraph.
| `--monitoring-address="0.0.0.0"` | IP address where the Memgraph's monitoring WebSocket server should listen. | `[string]` |
| `--monitoring-port=7444` | Port on which the Memgraph's monitoring WebSocket server should listen. | `[int32]` |
| `--password-encryption-algorithm=bcrypt` | Algorithm used for password encryption. Defaults to BCrypt. Allowed values: `bcrypt`, `sha256`, `sha256-multiple` (SHA256 with multiple iterations) | `[string]` |
-| `--replication-replica-check-frequency-sec` | The time duration in seconds between two replica checks/pings. If < 1, replicas will not be checked at all and the replica will never be recovered. The MAIN instance allocates a new thread for each REPLICA. | `[uint64]` |
+| `--replication-async-recovery-interval-sec=10` | Minimum time in seconds between two recovery rounds of an [ASYNC REPLICA](/database-management/clustering/replication/how-replication-works#async-replication-mode). A lower value shrinks the data-loss window when failing over to an ASYNC REPLICA, but MAIN re-sends its current WAL file more often under constant writes. `0` starts a round at every replica check that finds the REPLICA behind. Allowed values: 0–3600. | `[uint64]` |
+| `--replication-replica-check-frequency-sec=1` | Time in seconds between two replica checks (pings). The check also starts the recovery rounds that catch up ASYNC REPLICAs. The MAIN instance allocates a new thread for each REPLICA. Allowed values: 1–86400. Before Memgraph 3.15, a value below 1 turned the checks off. | `[uint64]` |
| `--replication-restore-state-on-startup=true` | Set to `true` when initializing an instance to restore the replication role and configuration upon restart. | `[bool]` |
| `--schema-info-enabled=false` | Set to `true` to enable run-time schema info tracking. | `[bool]` |
| `--strict-flag-check=false` | If `true`, Memgraph will error and exit when suspicious positional arguments are detected (e.g. `--bool-flag false` instead of `--bool-flag=false`). If `false`, a warning is logged instead. | `[bool]` |
diff --git a/pages/database-management/enabling-memgraph-enterprise.mdx b/pages/database-management/enabling-memgraph-enterprise.mdx
index 35a3efd8f..97bc7b293 100644
--- a/pages/database-management/enabling-memgraph-enterprise.mdx
+++ b/pages/database-management/enabling-memgraph-enterprise.mdx
@@ -86,9 +86,8 @@ SET DATABASE SETTING 'enterprise.license' TO 'License';
Setting a license key via `SET DATABASE SETTING` is validated immediately:
- A **malformed or undecodable** key is rejected with an error — the write does not go through.
- An **already-expired** key is rejected with an error — the write does not go through.
-- An **organization name mismatch** is not checked at write time; it is caught
- during the next revalidation and Memgraph will log a warning and fall back to
- community mode if no other valid source is available.
+- An **organization name mismatch** doesn't reject the write. Memgraph logs an
+ error and falls back to community mode if no other valid source is available.
To check the set values run:
@@ -139,6 +138,24 @@ data stored in the database will remain intact. You will still be able to add
more data, but any enterprise features that require specific actions will no
longer function. For example, you will not be able to create any new databases.
+Memgraph logs these license events:
+
+- **License about to expire:** while the active license is within 30 days of
+ its expiry date, a warning once a day with that date.
+- **No valid license:** when the active license is lost or a license you
+ provided is rejected, an error with the reason, such as an expired license or
+ an organization name that doesn't match the key.
+- **Incomplete license:** when a license key or organization name is set
+ without the other, a warning.
+- **Source ignored:** when a valid license is active but another source is
+ rejected, a warning with that source and the reason.
+
+Memgraph logs the last three once each time the license state changes. When no
+license is valid, the `status` column of
+[`SHOW LICENSE INFO`](/database-management/server-stats#license-information)
+gives the same reasons. Before Memgraph 3.15, Memgraph logged rejected licenses
+as warnings, every time it rechecked the license.
+
To renew an expired license, set the new key with `SET DATABASE SETTING` as
shown in [Providing the license](#providing-the-license). The change applies
immediately and no restart is needed. If Memgraph also receives the license
diff --git a/pages/database-management/logs.mdx b/pages/database-management/logs.mdx
index 07ea428a0..ac61e1b1f 100644
--- a/pages/database-management/logs.mdx
+++ b/pages/database-management/logs.mdx
@@ -112,7 +112,9 @@ read/write Cypher workload, not schema-maintenance operations.
### Configuring at runtime and per session
-The three settings can be changed globally at runtime and persist between runs:
+The three settings can be changed globally at runtime. A runtime value lasts
+until Memgraph restarts; to keep it, set the matching flag (`--log-min-duration-ms`,
+`--log-failed-queries`, `--log-query-plan`):
```cypher
SET DATABASE SETTING "log.min_duration_ms" TO "500";
diff --git a/pages/database-management/monitoring.mdx b/pages/database-management/monitoring.mdx
index 81e2011e4..24e93396b 100644
--- a/pages/database-management/monitoring.mdx
+++ b/pages/database-management/monitoring.mdx
@@ -44,6 +44,11 @@ connected clients in the following format:
}
```
+Memgraph queues up to 65,536 messages for each client. If a client reads more
+slowly than Memgraph logs, Memgraph drops the oldest queued messages and logs
+`Websocket client is not keeping up; dropping the oldest queued log messages`
+once for that connection. A read or write error closes the connection.
+
### Connection
diff --git a/pages/database-management/multi-tenancy.mdx b/pages/database-management/multi-tenancy.mdx
index 26f3fd839..a65910aba 100644
--- a/pages/database-management/multi-tenancy.mdx
+++ b/pages/database-management/multi-tenancy.mdx
@@ -166,8 +166,11 @@ Users interact with multi-tenant features through specialized Cypher queries:
transactions).
7. `GRANT DATABASE name TO user_or_role`: Grants a user or role access to a
specified database.
-8. `DENY DATABASE name FROM user_or_role`: Explicitly denies a user or role
- access to a specified database.
+8. `DENY DATABASE name TO user_or_role`: Explicitly denies a user or role
+ access to a specified database. Available since Memgraph 3.15; the older
+ `FROM` form still works, but is deprecated, returns a `DeprecatedQuery`
+ warning [notification](/database-management/query-metadata#notifications),
+ and stops working in a release no earlier than Memgraph 3.16.
9. `REVOKE DATABASE name FROM user_or_role`: Removes the database from the
user's or role's database access list.
10. `SET MAIN DATABASE name FOR user`: Sets a user's default (landing) database.
@@ -523,8 +526,8 @@ User-role mappings are simple maps located in the user. Renaming the database wi
-Access to all databases can be granted or revoked using wildcards:
-`GRANT DATABASE * TO user;`, `DENY DATABASE * FROM user;` or
+Access to all databases can be granted, denied, or revoked using wildcards:
+`GRANT DATABASE * TO user;`, `DENY DATABASE * TO user;` or
`REVOKE DATABASE * FROM user;`.
### Multi-database queries and the memgraph database
diff --git a/pages/database-management/query-metadata.mdx b/pages/database-management/query-metadata.mdx
index 40a42aef9..504d8466b 100644
--- a/pages/database-management/query-metadata.mdx
+++ b/pages/database-management/query-metadata.mdx
@@ -85,6 +85,7 @@ should be used only as messages.
- `CreateStream`
- `CheckStream`
- `CreateTrigger`
+- `DeprecatedQuery`
- `DropConstraint`
- `DropReplica`
- `DropIndex`
diff --git a/pages/database-management/server-stats.mdx b/pages/database-management/server-stats.mdx
index 0416e02cb..c2efa1aeb 100644
--- a/pages/database-management/server-stats.mdx
+++ b/pages/database-management/server-stats.mdx
@@ -195,7 +195,24 @@ An `ai_platform` license with `memory_limit == 0` reports the unlimited string,
not the AI Platform policy string.
If no license has been provided, `is_valid` is `false` and `status` reads
-`"You have not provided any license!"`.
+`"You have not provided any license."`.
+
+If a license was provided but none is valid, `is_valid` is `false` and
+`status` gives the reason for each license source Memgraph didn't use, as
+`[SOURCE] reason`. `SOURCE` is `DB` for database settings, `ENV` for
+environment variables, and `CLI` for command-line flags. For example, a key
+set with the `--license-key` flag and a mismatched `--organization-name` flag
+gives:
+
+```plaintext copy=false
+[CLI] The organization name 'YOUR_ORGANIZATION_NAME' does not match the license key, which is for 'LICENSED_ORGANIZATION_NAME'.
+```
+
+Other reasons are an expired license (with its expiry date) and a key that
+isn't a valid license key. For the `DB` and `ENV` sources, a license key or
+organization name set without the other is also a reason.
+Before Memgraph 3.15, `status` read `"You have not provided any license!"`
+whenever no license was valid, even with a key set.
diff --git a/pages/database-management/upgrades/deprecated-features.mdx b/pages/database-management/upgrades/deprecated-features.mdx
index cf120f9b7..c8cac69bb 100644
--- a/pages/database-management/upgrades/deprecated-features.mdx
+++ b/pages/database-management/upgrades/deprecated-features.mdx
@@ -1,28 +1,36 @@
---
title: Deprecated features
-description: Configuration flags that are deprecated or removed in Memgraph, and the versions where each change happened.
+description: Configuration flags and query syntax that are deprecated or removed in Memgraph, and the versions where each change happened.
---
# Deprecated features
-This section lists the configuration flags which have been deprecated, removed
-or replaced in Memgraph, and the versions where the changes happened.
+This section lists the configuration flags and query syntax which have been
+deprecated, removed or replaced in Memgraph, and the versions where the changes
+happened.
Removing a flag is a three-part process:
- From the **Deprecated in** version, the flag still works, but it is announced as going away.
- From the **Ignored from** version, Memgraph accepts the flag, but the flag has no effect.
- From the **Rejected from** version, Memgraph does not recognise the flag and fails to start if the flag is specified.
+Deprecated query syntax has no **Ignored from** version: it works and returns a
+`DeprecatedQuery` warning
+[notification](/database-management/query-metadata#notifications) until the
+**Rejected from** version.
+
## Currently deprecated
| Feature | Deprecated in | Ignored from | Rejected from | Replacement |
| ------- | ------------- | ------------ | ------------- | ----------- |
+| `DENY DATABASE ... FROM` | 3.15 | Not applicable | Not yet | [`DENY DATABASE ... TO`](/database-management/multi-tenancy#cypher-queries-for-multi-tenancy). |
| `JSON` value of `--metrics-format` | 3.11 | Not yet | Not yet | [`--metrics-format=OpenMetrics`](/database-management/monitoring#openmetrics-monitoring). `JSON` still works, but the default changed to `OpenMetrics` in 3.13, so pass `--metrics-format=JSON` to keep it. See [Migrating from JSON to OpenMetrics](/database-management/monitoring#migrating-from-json-to-openmetrics). |
## Removed
| Feature | Deprecated in | Ignored from | Rejected from | Replacement |
| ------- | ------------- | ------------ | ------------- | ----------- |
+| `*KSHORTEST (r, n \| )` with the filter as the only lambda | Not applicable | Not applicable | 3.15 | [`*KSHORTEST (r, n \| 1) (r, n \| )`](/advanced-algorithms/deep-path-traversal#k-shortest-paths-filter). A single lambda is now the weight lambda, and a filter in its place raises an error. |
| `--instance-down-timeout-sec` | 3.10 | 3.10 | 3.12 | [`SET COORDINATOR SETTING 'instance_down_timeout_sec'`](/database-management/clustering/high-availability/ha-commands-reference#instance_down_timeout_sec). Values are not migrated; re-apply non-default settings after upgrading. |
| `--instance-health-check-frequency-sec` | 3.10 | 3.10 | 3.12 | [`SET COORDINATOR SETTING 'instance_health_check_frequency_sec'`](/database-management/clustering/high-availability/ha-commands-reference#instance_health_check_frequency_sec). Values are not migrated; re-apply non-default settings after upgrading. |
| `--auth-module-executable` | 2.18 | 3.8 | 3.8 | [`--auth-module-mappings`](/database-management/authentication-and-authorization/auth-system-integrations#configuration-flags) |
diff --git a/pages/database-management/upgrades/specific-versions.mdx b/pages/database-management/upgrades/specific-versions.mdx
index 9deb41c52..bd6bdf0ae 100644
--- a/pages/database-management/upgrades/specific-versions.mdx
+++ b/pages/database-management/upgrades/specific-versions.mdx
@@ -9,6 +9,38 @@ Some Memgraph releases introduce breaking changes or modify internal behavior
in ways that require extra steps during an upgrade. Before upgrading, check
whether your target version is listed below and follow the corresponding guide.
+## v3.15 - Reserved memgraph_internal name
+
+Memgraph 3.15 reserves the name `memgraph_internal` for the [internal system
+user](/database-management/authentication-and-authorization/users#internal-system-user),
+even when `--system-user-internal-hash-file` is empty. Before upgrading:
+
+1. **Users and roles:** if a user or role named `memgraph_internal` exists,
+ create one under another name with the same privileges and drop the old
+ one. In a replicated cluster, do this on MAIN and check with `SHOW USERS`
+ and `SHOW ROLES` that the change reached every REPLICA. Rename coordinator
+ roles with that name too.
+2. **LDAP and SSO:** rename users and groups with that name in the identity
+ provider. After the upgrade, Memgraph refuses a login whose auth module
+ returns `memgraph_internal` as the username or as a role.
+3. **Scripts:** change scripts that run `CREATE USER IF NOT EXISTS
+ memgraph_internal` or `CREATE ROLE IF NOT EXISTS memgraph_internal`. Both
+ now fail with `The name 'memgraph_internal' is reserved for the internal
+ system user.`
+4. **Passwords:** a script that sets a plaintext password starting with
+ `bcrypt:`, `sha256:`, `sha256-multiple:` or `pbkdf2-sha256:` now fails,
+ unless the password is a valid [pre-hashed
+ password](/database-management/authentication-and-authorization/users#administer-users).
+ Passwords already stored keep working.
+
+An instance with a stored `memgraph_internal` user or role starts and logs a
+warning. With `--system-user-internal-hash-file` set, it refuses to start.
+Replication doesn't check the name, so a `memgraph_internal` user or role on a
+MAIN that isn't upgraded yet reaches upgraded REPLICAs. If a REPLICA refuses
+to start because of it, start it without `--system-user-internal-hash-file`,
+rename the user or role on MAIN, and restart the REPLICA with the flag once
+the change has replicated.
+
## v3.14 - Profile changes in transactions
Memgraph 3.14 refuses [user
diff --git a/pages/deployment/best-practices.mdx b/pages/deployment/best-practices.mdx
index eff4f2e42..d8ac017d8 100644
--- a/pages/deployment/best-practices.mdx
+++ b/pages/deployment/best-practices.mdx
@@ -250,7 +250,7 @@ flags to consider:
SET DATABASE SETTING "query.timeout" TO "0";
```
- This is particularly useful in environments where you don’t want to restart Memgraph but still need to adjust timeout behavior for specific workloads.
+ This is particularly useful in environments where you don’t want to restart Memgraph but still need to adjust timeout behavior for specific workloads. The value lasts until Memgraph restarts, after which `--query-execution-timeout-sec` applies again.
For more information on how to configure Memgraph, as well as what are all the flags that Memgraph can be configured on, please
check out the [configuration documentation page](/database-management/configuration).
diff --git a/pages/fundamentals/data-types.mdx b/pages/fundamentals/data-types.mdx
index 3d4520caf..88c2cd69d 100644
--- a/pages/fundamentals/data-types.mdx
+++ b/pages/fundamentals/data-types.mdx
@@ -578,7 +578,8 @@ The timezone can be defined via:
1. `--timezone` command-line argument
1. `SET DATABASE SETTING "timezone" TO "Europe/Rome"` query
-Both methods use IANA timezone descriptors to specify the timezone. See [list of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
+A timezone set with the query lasts until Memgraph restarts; to keep it, use the
+`--timezone` flag. Both methods use IANA timezone descriptors to specify the timezone. See [list of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
diff --git a/pages/getting-started/install-memgraph/docker.mdx b/pages/getting-started/install-memgraph/docker.mdx
index e18fb2f44..c7ce743f2 100644
--- a/pages/getting-started/install-memgraph/docker.mdx
+++ b/pages/getting-started/install-memgraph/docker.mdx
@@ -221,7 +221,32 @@ true:
|---|---|
| `14` | The OpenSSL FIPS provider is unavailable or not operational |
| `15` | `--password-encryption-algorithm` is set to a non-approved algorithm |
-| `16` | No valid Enterprise license |
+| `16` | No valid Enterprise license at startup, and init queries are set (`--init-file`, `--init-data-file` or `MEMGRAPH_HA_CLUSTER_INIT_QUERIES`) |
+
+Without a valid Enterprise license, an instance in approved mode starts, logs
+a warning, and refuses every query except `SHOW LICENSE INFO`,
+`SHOW DATABASE SETTINGS`, `SET DATABASE SETTING 'organization.name'` and
+`SET DATABASE SETTING 'enterprise.license'`. A client such as a Kubernetes
+operator can then set the license over Bolt. Every other query, `BEGIN`
+included, fails with:
+
+```plaintext copy=false
+FIPS mode requires a valid enterprise license. Until one is set, only SHOW LICENSE INFO, SHOW DATABASE SETTINGS, SET DATABASE SETTING 'organization.name' and SET DATABASE SETTING 'enterprise.license' are accepted.
+```
+
+Init queries run at startup, before a license can be set over Bolt, so with
+any of them set the license has to be given at startup: `--license-key` and
+`--organization-name`, or the `MEMGRAPH_ENTERPRISE_LICENSE` and
+`MEMGRAPH_ORGANIZATION_NAME` environment variables.
+
+The same restriction applies when the license expires while the instance
+runs. From then on, only those queries are served until a valid license is
+set. A transaction open at that moment keeps its writes only if `COMMIT` is
+its next statement, and running streams stop; start them again with
+`START STREAM` once the license is set.
+
+Before Memgraph 3.15, an instance in approved mode without a valid license
+refused to start with exit code `16`.
{What approved mode enforces
}
@@ -232,8 +257,12 @@ true:
15.
- **TLS** negotiates a minimum of TLS 1.2 on every connection Memgraph accepts
or makes, including replication and the coordinator's Raft port.
-- **Pre-computed password hashes** (`CREATE USER … IDENTIFIED BY
- 'bcrypt:$2a$…'`) are rejected.
+- **Pre-computed password hashes** are accepted only as pbkdf2-sha256
+ (`CREATE USER … IDENTIFIED BY 'pbkdf2-sha256:600000::'`, see
+ [pre-hashed
+ passwords](/database-management/authentication-and-authorization/users#administer-users)).
+ bcrypt, sha256 and sha256-multiple hashes are rejected. Before Memgraph
+ 3.15, every pre-computed hash was rejected.
{Verifying approved mode
}
diff --git a/pages/querying/time-to-live.mdx b/pages/querying/time-to-live.mdx
index 6f6d1ec5b..4aceeaf70 100644
--- a/pages/querying/time-to-live.mdx
+++ b/pages/querying/time-to-live.mdx
@@ -17,6 +17,12 @@ Time-to-live allows a user to tag vertices and edges with an expiration time. On
+**Breaking change in v3.15.0**: TTL can stay stopped after you upgrade from an earlier version, because an earlier version can record a running TTL as stopped. Run the `ENABLE TTL` query on the MAIN instance for each database where TTL should run. It resumes TTL with its earlier configuration, and does nothing if TTL is already running.
+
+
+
+
+
The `TTL` label and `ttl` property are reserved names for TTL. See [Tagging objects](#tagging-objects) for more info.
@@ -107,6 +113,12 @@ ENABLE TTL;
**NOTE:** Once stopped, ttl can be re-enabled with the old configuration or a new one.
+Memgraph remembers whether TTL is running or stopped:
+- **Restart:** a TTL you enabled with the `ENABLE TTL` query runs again, and a TTL you stopped with the `STOP TTL` query stays stopped.
+- **Promotion to MAIN:** a REPLICA promoted to MAIN resumes TTL unless you stopped it with the `STOP TTL` query. See [Replication](#replication).
+
+Before Memgraph 3.15, a running TTL could stay stopped after a restart, and promoting a REPLICA to MAIN resumed a stopped TTL.
+
To stop and drop any index created, run:
```cypher
@@ -203,7 +215,7 @@ Time-to-live is fully integrated with replication:
- The TTL background job executes only on the MAIN instance
- All TTL deletions are automatically replicated to REPLICA instances
- TTL configuration is now properly replicated across instances
-- If an instance is a REPLICA, the TTL background job will be paused until the instance becomes MAIN
+- If an instance is a REPLICA, the TTL background job is paused until the instance becomes MAIN, and then resumes unless you stopped it with the `STOP TTL` query
diff --git a/pages/querying/vector-search.mdx b/pages/querying/vector-search.mdx
index cfe87bae3..60d00850a 100644
--- a/pages/querying/vector-search.mdx
+++ b/pages/querying/vector-search.mdx
@@ -362,7 +362,8 @@ database but out of returned objects, enable
`--storage-omit-vector-index-properties-on-return` (setting
`storage.omit_vector_index_properties_on_return`, default `false`). It is
toggleable at runtime - no restart - and can also be set on startup via the
-[flag](/database-management/configuration#storage):
+[flag](/database-management/configuration#storage). A value set at runtime lasts
+until Memgraph restarts; to keep it, use the flag:
```cypher
SET DATABASE SETTING 'storage.omit_vector_index_properties_on_return' TO 'true';
diff --git a/pages/release-notes.mdx b/pages/release-notes.mdx
index eb6c1fef1..79b8327ad 100644
--- a/pages/release-notes.mdx
+++ b/pages/release-notes.mdx
@@ -46,6 +46,293 @@ guide.
## 🚀 Latest release
+### Memgraph v3.15.0 - December 9th, 2026
+
+{⚠️ Breaking changes
}
+
+- A single lambda after `*KSHORTEST` is now the weight lambda, not a filter.
+ [K shortest paths filter](/advanced-algorithms/deep-path-traversal#k-shortest-paths-filter)
+ [#4861](https://github.com/memgraph/memgraph/pull/4861)
+ - Before: `*KSHORTEST (r, n | )` limited the search to the
+ relationships and nodes the filter allowed.
+ - Now: the same query raises an error that says to put the weight lambda
+ first.
+ - What to do: rewrite the filter as `(r, n | 1) (r, n | )`.
+- Values set with `SET DATABASE SETTING` no longer survive a restart, except
+ the license and AWS settings.
+ [Change configuration during runtime](/database-management/configuration#change-configuration-during-runtime)
+ [#5013](https://github.com/memgraph/memgraph/pull/5013)
+ - Before: most run-time settings were stored and applied again at every
+ start, unless their flag was set.
+ - Now: each of these settings takes the value of its flag, or the flag's
+ default, at every start, and the first start after upgrading applies a
+ stored value only once.
+ - What to do: before the second restart after upgrading, set the matching
+ flag for every value to keep.
+- Promotion to MAIN no longer resumes a stopped TTL, so TTL can stay stopped
+ after upgrading until `ENABLE TTL` runs again.
+ [Time to live configuration](/querying/time-to-live#configuration)
+ [#5073](https://github.com/memgraph/memgraph/pull/5073)
+ - Before: every promotion to MAIN, after a failover or a restart, resumed
+ TTL.
+ - Now: promotion resumes TTL only where it was running, but a snapshot from
+ an earlier version can record a running TTL as stopped, so after
+ upgrading expired nodes can stop being deleted.
+ - What to do: once every instance runs the new version, run `ENABLE TTL;`
+ on MAIN in each database where TTL should run (after `USE DATABASE` for
+ one other than `memgraph`), which resumes it with its earlier
+ configuration.
+- `{*}` in a property privilege no longer removes the grants and denies on
+ named properties in the same rule.
+ [Wildcard and named properties in one rule](/database-management/authentication-and-authorization/role-based-access-control#wildcard-and-named-properties-in-one-rule)
+ [#5160](https://github.com/memgraph/memgraph/pull/5160)
+ - Before: a `GRANT`, `DENY` or `REVOKE` on `{*}` also removed the named
+ grants or denies in the rule.
+ - Now: `{*}` applies to a property only for the privileges it has no grant
+ or deny of its own for.
+ - What to do: remove a named grant or deny by naming the property, and check
+ scripts that relied on a `{*}` statement to clear named properties.
+- The name `memgraph_internal` is reserved for the new internal system user,
+ in any letter case, even when `--system-user-internal-hash-file` isn't set.
+ [Reserved name](/database-management/authentication-and-authorization/users#reserved-name)
+ [Upgrade guide](/database-management/upgrades/specific-versions#v315---reserved-memgraph_internal-name)
+ [#5170](https://github.com/memgraph/memgraph/pull/5170)
+ - Before: `memgraph_internal` was an ordinary name for a user, a role, or an
+ LDAP or SSO user or group.
+ - Now: Memgraph refuses to create it or to log in an LDAP or SSO user that
+ returns it, and one stored before the upgrade still works but stops
+ Memgraph from starting when `--system-user-internal-hash-file` is set.
+ - What to do: before upgrading, rename `memgraph_internal` users and roles
+ on MAIN and in the identity provider, and change scripts that create the
+ name.
+- An unquoted `true` or `false` used as a name keeps the spelling you wrote.
+ [#5187](https://github.com/memgraph/memgraph/pull/5187)
+ - Before: an unquoted `false` used as a map key, property, label,
+ relationship type or variable was read as `true`, so `RETURN {false: 1}`
+ returned `{true: 1}`.
+ - Now: it stays `false`. `RETURN false` still returns the boolean.
+ - What to do: names stored as `true` this way aren't renamed. Before
+ upgrading, check your data, `SHOW TRIGGERS`, `SHOW USERS` and `SHOW ROLES`
+ for names you wrote as unquoted `false`.
+- `link_prediction` saves and loads only model weights.
+ [`load_context()`](/advanced-algorithms/available-algorithms/gnn_link_prediction#load_context)
+ [#5299](https://github.com/memgraph/memgraph/pull/5299)
+ - Before: `load_context()` loaded the whole saved model, which could run
+ arbitrary code.
+ - Now: it loads only weights, so models saved by earlier versions can't be
+ loaded.
+ - What to do: train saved models again.
+- Database names have rules.
+ [#5336](https://github.com/memgraph/memgraph/pull/5336)
+ - Before: `CREATE DATABASE` and `RENAME DATABASE` accepted any name,
+ including an empty one or one with a newline.
+ - Now: they refuse a name that is empty, longer than 63 bytes, contains a
+ control character, or starts or ends with a space.
+ - What to do: change scripts that create such names. Existing databases
+ with such a name still load and can be renamed or dropped.
+
+{
+✨ New features
}
+
+- ASYNC replicas catch up from durability files in rounds spaced by the new
+ `--replication-async-recovery-interval-sec` flag (default 10 seconds)
+ instead of receiving each transaction as it commits, so the data-loss window
+ when failing over to an ASYNC replica is at least that interval. Under
+ constant writes, `SHOW REPLICAS` shows a healthy ASYNC replica as `invalid`
+ most of the time. `--replication-replica-check-frequency-sec` must be
+ between 1 and 86400, so `0`, which used to turn the check off, fails startup.
+ [ASYNC replication mode](/database-management/clustering/replication/how-replication-works#async-replication-mode)
+ [#4694](https://github.com/memgraph/memgraph/pull/4694)
+- `*KSHORTEST` takes a weight lambda and an optional total weight variable, as
+ in `*KSHORTEST (r, n | r.weight) total_weight`, and returns paths cheapest
+ first, then by fewest hops.
+ [K shortest paths](/advanced-algorithms/deep-path-traversal#order-paths-by-weight)
+ [#4861](https://github.com/memgraph/memgraph/pull/4861)
+- The internal system user, `memgraph_internal`, lets automation such as the
+ Kubernetes operator log in on data instances and coordinators, enabled with
+ `--system-user-internal-hash-file`. `CREATE USER` and `SET PASSWORD` accept
+ pre-hashed pbkdf2-sha256 passwords, also with `--fips-mode`, which used to
+ reject every pre-hashed password. With `--fips-mode`, an instance without a
+ valid license starts instead of refusing to, and accepts only the queries
+ that show or set the license, also when the license expires while it runs.
+ [Internal system user](/database-management/authentication-and-authorization/users#internal-system-user)
+ [#5170](https://github.com/memgraph/memgraph/pull/5170)
+- `DENY DATABASE TO ` matches the other `DENY`
+ statements. `DENY DATABASE ... FROM` still works, but is deprecated, returns
+ a `DeprecatedQuery` warning and stops working in 3.16 at the earliest.
+ [Cypher queries for multi-tenancy](/database-management/multi-tenancy#cypher-queries-for-multi-tenancy)
+ [#5178](https://github.com/memgraph/memgraph/pull/5178)
+- `cross_database.s3()` takes an optional `bucket_owner` key in its `config`
+ map, a 12-digit AWS account ID. When it's set, the read fails if the bucket
+ belongs to another account.
+ [`s3()`](/advanced-algorithms/available-algorithms/cross_database#s3)
+ [#5293](https://github.com/memgraph/memgraph/pull/5293)
+
+{🐞 Bug fixes
}
+
+- With an `AI_PLATFORM` license, read queries that sort, deduplicate or
+ aggregate vector-indexed embeddings stay within the memory limit instead of
+ failing well below it.
+ [#4780](https://github.com/memgraph/memgraph/pull/4780)
+- `*KSHORTEST` no longer returns a path that ends at a node the user has no
+ label permission to read.
+ [#4860](https://github.com/memgraph/memgraph/pull/4860)
+- `--query-execution-timeout-sec` and `query.timeout` accept only values from
+ 0 (no limit) to 1000000000, so a larger value no longer makes every slow
+ query time out at once. Memgraph refuses to start with an out-of-range flag.
+ [#5013](https://github.com/memgraph/memgraph/pull/5013)
+- A running TTL keeps running after a restart.
+ [#5073](https://github.com/memgraph/memgraph/pull/5073)
+- `*KSHORTEST` under `USING HOPS LIMIT` returns only the paths it has proven to
+ be the shortest, instead of sometimes returning a longer path in place of a
+ shorter one.
+ [#5116](https://github.com/memgraph/memgraph/pull/5116)
+- A write that hits a memory limit while changing nodes covered by a point
+ index fails with "Memory limit exceeded", and the instance keeps running.
+ [#5140](https://github.com/memgraph/memgraph/pull/5140)
+- A read query that hits a memory limit while reading nodes that other
+ transactions changed since it started fails with "Memory limit exceeded",
+ and the instance keeps running.
+ [#5146](https://github.com/memgraph/memgraph/pull/5146)
+- An instance with lightweight edges (`--storage-light-edge=true`) whose
+ snapshot recovery hits the memory limit fails recovery with "Memory limit
+ exceeded" instead of crashing.
+ [#5147](https://github.com/memgraph/memgraph/pull/5147)
+- A query that pairs one pattern with another whose own variables are
+ compared to each other returns the matching rows instead of an empty result.
+ [#5169](https://github.com/memgraph/memgraph/pull/5169)
+- `CREATE USER` and `SET PASSWORD` refuse a password that starts with a hash
+ prefix such as `bcrypt:` but isn't a valid hash, instead of storing it as a
+ plaintext password.
+ [#5170](https://github.com/memgraph/memgraph/pull/5170)
+- A map literal that reads two or more properties of the same variable
+ returns each node's own properties instead of repeating the first node's.
+ [#5181](https://github.com/memgraph/memgraph/pull/5181)
+- Tenant databases on a replica use the replica's own per-database flags, as
+ its default database already did, instead of the values MAIN sent and the
+ built-in defaults, so every instance in a cluster needs the same
+ per-database flags.
+ [#5192](https://github.com/memgraph/memgraph/pull/5192)
+- A replica no longer deletes its users, roles and databases when MAIN's
+ license becomes invalid.
+ [#5195](https://github.com/memgraph/memgraph/pull/5195)
+- Time-to-live no longer deletes data while the license is invalid.
+ [#5205](https://github.com/memgraph/memgraph/pull/5205)
+- The metrics endpoints, in both JSON and OpenMetrics format, serve metrics
+ only with a valid Enterprise license, as they did before Memgraph 3.11.
+ [#5207](https://github.com/memgraph/memgraph/pull/5207)
+- `llm.complete()` without a configured model (`config.model` or
+ `LITELLM_MODEL`) uses `openai/gpt-5.6-terra` instead of `gpt-5-mini`, which
+ OpenAI removes from its API on December 11, 2026.
+ [#5219](https://github.com/memgraph/memgraph/pull/5219)
+- A filter on a nested property returns the same rows whether or not an index
+ on that path exists.
+ [#5222](https://github.com/memgraph/memgraph/pull/5222)
+- A database's tracked graph memory (`graph_memory_tracked`) matches the
+ global total after a vector-indexed property is overwritten or removed, and
+ `SET n += {...}` and `SET n = {...}` on nodes apply
+ `--storage-delta-on-identical-property-update` instead of its inverse.
+ [#5229](https://github.com/memgraph/memgraph/pull/5229)
+- Invalid query input, such as `duration('PXYZ')`, is reported to Bolt
+ clients as a `ClientError`, so drivers no longer retry it.
+ [#5231](https://github.com/memgraph/memgraph/pull/5231)
+- A `USING HOPS LIMIT` query no longer crashes Memgraph when another
+ transaction changes the relationships of a node it reads.
+ [#5248](https://github.com/memgraph/memgraph/pull/5248)
+- Datetimes in the hour that daylight saving time skips or repeats convert
+ instead of raising an error, cron schedules no longer run back to back
+ through the repeated hour, and a scheduled task that fails is tried again at
+ its next run instead of stopping Memgraph. A zoned datetime keeps the
+ timezone it names.
+ [#5298](https://github.com/memgraph/memgraph/pull/5298)
+- Profile limits apply to users whose names contain uppercase letters. If
+ older data assigns a user to several profiles under different spellings,
+ choose one with `SET PROFILE FOR TO ` before a rolling
+ upgrade.
+ [#5305](https://github.com/memgraph/memgraph/pull/5305)
+- A SYNC replica that replicated a transaction successfully is no longer
+ marked as behind right after it.
+ [#5307](https://github.com/memgraph/memgraph/pull/5307)
+- `GRANT`, `DENY` and `REVOKE` with the `COORDINATOR` privilege, removed in
+ Memgraph 3.13, fail with an error that points to `COORDINATOR_READ` and
+ `COORDINATOR_WRITE` instead of a generic parse error.
+ [#5327](https://github.com/memgraph/memgraph/pull/5327)
+- `DUMP DATABASE` writes floats so that importing the dump restores the same
+ values, including large, integral and non-finite ones.
+ [#5334](https://github.com/memgraph/memgraph/pull/5334)
+- An index scan no longer misses a node or relationship when another
+ transaction writes the same value to its indexed property while the scan is
+ running, and a unique constraint no longer accepts a duplicate value after
+ garbage collection.
+ [#5343](https://github.com/memgraph/memgraph/pull/5343)
+- Reaching the memory limit while Memgraph reads or writes its internal stores
+ (users and roles, settings, server-side parameters, triggers and streams) no
+ longer hangs later writes to that store or crashes Memgraph.
+ [#5368](https://github.com/memgraph/memgraph/pull/5368)
+- After an S3 query (`LOAD CSV` or `LOAD PARQUET` from `s3://`) fails on the
+ memory limit, later S3 queries no longer crash Memgraph.
+ [#5372](https://github.com/memgraph/memgraph/pull/5372)
+- With an edge index, a pattern whose end node is already bound, or a
+ self-loop such as `MATCH (n)-[:T]->(n)`, no longer returns relationships
+ that don't touch that node.
+ [#5406](https://github.com/memgraph/memgraph/pull/5406)
+- `propertySize()` on a relationship no longer hangs while another
+ transaction writes that relationship.
+ [#5413](https://github.com/memgraph/memgraph/pull/5413)
+- Creating a text index that names the same property twice now raises an
+ error; before, the property was indexed as missing.
+ [#5415](https://github.com/memgraph/memgraph/pull/5415)
+
+{🛠️ Improvements
}
+
+- `*KSHORTEST` path expansion uses less memory and runs faster when it returns
+ many paths, most of all with a large `|k`.
+ [#5121](https://github.com/memgraph/memgraph/pull/5121)
+- Traversing the relationships of a node with a very high degree (a
+ supernode) uses much less memory while the query runs. Results are
+ unchanged, including the order relationships come back in.
+ [#5154](https://github.com/memgraph/memgraph/pull/5154)
+- A `RETURN` or `WITH` that reads several properties of the same node or
+ relationship reads them in one pass over its properties instead of one pass
+ per property. `--query-cache-properties=false` turns this off.
+ [#5155](https://github.com/memgraph/memgraph/pull/5155)
+- `*KSHORTEST` path expansion runs faster, most of all with a weight lambda or a
+ large `|k`.
+ [#5159](https://github.com/memgraph/memgraph/pull/5159)
+- A `RETURN` or `WITH` that sorts and limits evaluates its projected
+ expressions only for the rows it returns, so a costly expression no longer
+ runs for rows the `LIMIT` discards. Building a string with `reduce` no
+ longer slows down sharply as the list grows. An expression that would fail
+ only on a row that `SKIP` or `LIMIT` discards no longer raises an error.
+ [#5161](https://github.com/memgraph/memgraph/pull/5161)
+- When no license is valid, `SHOW LICENSE INFO` says why each license source
+ was rejected, instead of "You have not provided any license!". Memgraph logs
+ a lost or rejected license once as an error instead of repeating warnings,
+ and warns once a day in the last 30 days before the license expires.
+ [License information](/database-management/server-stats#license-information)
+ [License key expiry](/database-management/enabling-memgraph-enterprise#license-key-expiry)
+ [#5194](https://github.com/memgraph/memgraph/pull/5194)
+- A breadth-first expansion from a single source (`*BFS`) runs faster, the
+ more so the higher the degree of the nodes it walks through. Results are
+ unchanged, including the order relationships come back in.
+ [#5214](https://github.com/memgraph/memgraph/pull/5214)
+- HTTPS requests that Memgraph sends for telemetry and license reporting
+ require TLS 1.2 or newer, as file downloads already did.
+ [#5241](https://github.com/memgraph/memgraph/pull/5241)
+- A query that a memory limit stops while one of Memgraph's internal hash
+ tables grows fails without leaving that table corrupted.
+ [#5339](https://github.com/memgraph/memgraph/pull/5339)
+- Under property-level permissions, a query that returns several properties
+ of the same node checks the permissions once per node, not once per
+ property.
+ [#5414](https://github.com/memgraph/memgraph/pull/5414)
+
+### Lab v3.15.0 - December 9th, 2026
+
+
+
+## Previous releases
+
### Memgraph v3.14.0 - October 21st, 2026
{⚠️ Breaking changes
}
@@ -460,8 +747,6 @@ guide.
-## Previous releases
-
### Memgraph v3.13.2 - October 9th, 2026
{🐞 Bug fixes
}
diff --git a/public/pages/clustering/replication/memgraph-replication-async.png b/public/pages/clustering/replication/memgraph-replication-async.png
deleted file mode 100644
index b154eff2f..000000000
Binary files a/public/pages/clustering/replication/memgraph-replication-async.png and /dev/null differ