如何在 arangodb-php 中增加流式交易的 `maxTransactionSize`

How to increase `maxTransactionSize` for Streaming Transactions in arangodb-php

文档说作为事务属性传递(对 /begin 的调用):

maxTransactionSize: Transaction size limit in bytes. Honored by the RocksDB storage engine only.

我设法做到了这一点,尽管 php-client 忽略了该属性,但在我将事务实例移交给处理程序之前手动设置它:

 $trx->set('maxTransactionSize', $config['maxTransactionSize'])

这是调用 begin 之前的事务属性 ($trx->attributes) 的 var_dump

includes/libs/arangodb/lib/ArangoDBClient/StreamingTransactionHandler.php:50:
array(2) {
  'collections' =>
    array(3) {
      'read' =>
       array(0) {
      }
      'write' =>
       array(0) {
      }
      'exclusive' =>
       array(1) {
         [0] =>
          string(7) "actions"
       }
    }
  'maxTransactionSize' =>
  int(536870912)
}

但是交易失败:

error : AQL: aborting transaction because maximal transaction size limit of 134217728 bytes is reached (while executing)

我missing/doing哪里错了?

我在 3.5.4 和 3.6.1 上测试过,结果相同。

事实证明,阅读整个文档是明智的。 128MB 是流式交易大小的硬性上限。

A maximum lifetime and transaction size for stream transactions is enforced on the Coordinator to ensure that transactions cannot block the cluster from operating properly:

Maximum idle timeout of 10 seconds between operations Maximum transaction size of 128 MB per DB-Server These limits are also enforced for stream transactions on single servers.

这意味着您必须为需要更多内存的查询使用 js 事务。 arangodb-php 客户端提供 Transaction.php 在客户端包装这些,不需要 write/extend foxx-app —— 至少,没有在文档中提到的限制js 交易 (https://www.arangodb.com/docs/devel/http/transaction-js-transaction.html).

编辑:我将我的案例重新实现为 js-transaction,它顺利完成。