简体   繁体   English

如何在 arangodb-php 中为流式事务增加 `maxTransactionSize`

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

The documentation says to pass as transaction-attribute (the call to /begin ):文档说作为事务属性传递(对/begin的调用):

maxTransactionSize: Transaction size limit in bytes. maxTransactionSize:以字节为单位的交易大小限制。 Honored by the RocksDB storage engine only.仅由 RocksDB 存储引擎授予。

I manage to do just that, despite the fact that the php -client ignores the attribute, by setting it manually before I hand the transaction-instance over to the handler:我设法做到了这一点,尽管php -client 忽略了该属性,但在我将事务实例交给处理程序之前手动设置它:

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

This is var_dump of the transaction attributes ( $trx->attributes ) directly prior to the call to begin :这是直接在调用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)
}

But the transaction fails with:但交易失败:

error : AQL: aborting transaction because maximal transaction size limit of 134217728 bytes is reached (while executing)错误:AQL:中止事务,因为达到了 134217728 字节的最大事务大小限制(执行时)

What am I missing/doing wrong?我错过了什么/做错了什么?

I tested this on 3.5.4 and 3.6.1, with the same result.我在 3.5.4 和 3.6.1 上对此进行了测试,结果相同。

Turns out it's prudent to read the whole documentation.事实证明,阅读整个文档是明智的。 128MB is a hard upper limit for the size of a streaming transaction. 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:在 Coordinator 上强制执行流事务的最大生命周期和事务大小,以确保事务不会阻止集群正常运行:

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.操作之间的最大空闲超时为 10 秒 每个 DB-Server 的最大事务大小为 128 MB 这些限制也适用于单个服务器上的流事务。

This means you have to use a js-transaction for queries that need more memory.这意味着您必须对需要更多内存的查询使用 js-transaction。 The arangodb-php client provides Transaction.php to wrap these on the client side, there's no need to write/extend a foxx-app -- at least, there are no limitations mentioned in the documentation of js-transactions ( https://www.arangodb.com/docs/devel/http/transaction-js-transaction.html ). arangodb-php 客户端提供Transaction.php来包装这些在客户端,不需要编写/扩展 Foxx-app —— 至少,js-transactions 的文档中没有提到任何限制( https:// www.arangodb.com/docs/devel/http/transaction-js-transaction.html )。

Edit: I re-implemented my case as js-transaction, and it completes unhindered.编辑:我将我的案例重新实现为 js-transaction,并且它不受阻碍地完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM