首页 \ 问答 \ 删除Solr服务器上的updateLog(Remove updateLog on Solr server)

删除Solr服务器上的updateLog(Remove updateLog on Solr server)

我注意到当我禁用updateLog时(通过从solrconfig.xml中删除它),索引速率提高了25%。
服务器是独立的,我们没有使用原子更新。
我想知道是否有其他副作用或功能会破坏。


I've noticed that there is 25% improvement in indexing rate when I disable the updateLog (by removing it from solrconfig.xml).
The server is standalone and we are not using atomic update.
I was wondering if there are other side effects or features which will break.


原文:https://stackoverflow.com/questions/37568621
更新时间:2022-09-06 21:09

最满意答案

对于在同一个表上运行50到100个并发进程的系统,我对此进行了大量的研究和实验。 除了基本的死锁之外,还有许多事务失败。 我的案例包括read committed和serializable事务。 在应用程序级别处理此问题并不会导致任何问题。 幸运的是Postgres会立即失败,所以唯一的性能打击是应用程序,对数据库没有任何重要意义。

关键组件是捕获每种类型的错误 ,知道哪些情况需要回滚,并具有重试指数退避 。 我发现立即重试或静态睡眠时间会导致进程重复地相互死锁并引起一些多米诺骨牌效应,这是有道理的。

这是我的系统处理每个并发问题(伪代码)所需的完整逻辑:

begin transaction (either read committed or serializable)
while not successful and count < 5
    try 
        execute sql
        commit
    except
        if error code is '40P01' or '55P03'
            # Deadlock or lock not available
            sleep a random time (200 ms to 1 sec) * number of retries
        else if error code is '40001' or '25P02'
            # "In failed sql transaction" or serialized transaction failure
            rollback
            sleep a random time (200 ms to 1 sec) * number of retries
            begin transaction
        else if error message is 'There is no active transaction'
            sleep a random time (200 ms to 1 sec) * number of retries
            begin transaction
    increment count

I did a lot of research and experimentation into this for a system that's running 50 to 100 concurrent processes on the same tables. There are a number of transaction failures that can happen besides basic deadlocks. My case includes both read committed and serializable transactions. There's no situation where handling this at the application level caused any issues. Fortunately Postgres will fail immediately, so the only performance hit is to the application, nothing significant to the database.

The key components are catching every type of error, knowing which cases require a rollback, and having an exponential backoff for retries. I found that immediate retries or static sleep times cause processes to simply deadlock each other repeatedly and cause a bit of a domino effect, which makes sense.

This is the complete logic my system requires to handle every concurrency issue (pseudocode):

begin transaction (either read committed or serializable)
while not successful and count < 5
    try 
        execute sql
        commit
    except
        if error code is '40P01' or '55P03'
            # Deadlock or lock not available
            sleep a random time (200 ms to 1 sec) * number of retries
        else if error code is '40001' or '25P02'
            # "In failed sql transaction" or serialized transaction failure
            rollback
            sleep a random time (200 ms to 1 sec) * number of retries
            begin transaction
        else if error message is 'There is no active transaction'
            sleep a random time (200 ms to 1 sec) * number of retries
            begin transaction
    increment count

相关问答

更多
  • 死锁返回错误1213 ,您应该在客户端进行处理 请注意,死锁和锁等待是不同的事情。 在僵局中,没有“失败”的交易:他们都有罪。 无法保证哪一个会回滚。 在这种情况下发生死锁: UPDATE t_first -- transacion 1 locks t_first SET id = 1; UPDATE t_second -- transaction 2 locks t_second SET id = 2; UPDATE t_second -- transaction 1 waits ...
  • 唯一不能真正放入varchar的是0x00,因为这是一个字符串终止符。 0x04工作正常,就像其他不可打印的字符一样。 The only thing you can not really put into varchar is 0x00, as this is a string terminator. 0x04 works just fine, just like other non-printable characters.
  • 对于在同一个表上运行50到100个并发进程的系统,我对此进行了大量的研究和实验。 除了基本的死锁之外,还有许多事务失败。 我的案例包括read committed和serializable事务。 在应用程序级别处理此问题并不会导致任何问题。 幸运的是Postgres会立即失败,所以唯一的性能打击是应用程序,对数据库没有任何重要意义。 关键组件是捕获每种类型的错误 ,知道哪些情况需要回滚,并具有重试的指数退避 。 我发现立即重试或静态睡眠时间会导致进程重复地相互死锁并引起一些多米诺骨牌效应,这是有道理的。 这 ...
  • 这并不奇怪。 now()返回事务开始的时间。 无法保证首先启动的事务将是第一个执行触发器的事务。 使用该版本确定更新的顺序。 That is not surprising. now() returns the time when the transaction started. There is no guarantee that the transaction that starts first will be the first one to perform the trigger. Use the v ...
  • 你不需要任何明确的LOCK进入死锁。 这里是一个非常简单的演示,从头开始只有INSERT: create table a(i int primary key); create table b(i int primary key); 会议#1确实: begin; insert into a values(1); 然后,会话#2会: begin; insert into b values(1); insert into a values(1); -- here it goes into waiting fo ...
  • 死锁检测可以在更高级别完成,对于进程,死锁检测可以在操作系统级别完成,对于线程,主线程可以检测子线程之间的死锁,如果子线程不需要任何系统级资源I / O等 检测死锁的一种方法是为共享资源构建资源需求图。 假设系统创建了2个线程Ta和Tb,Ta和Tb都需要资源Ra和Rb。 如果Ta已经获得了Ra,并且需要Rb,则这可以像有向图:Ra-> Ta-> Rb。 如果Tb持有Rb,这将类似于Ra-> Ta-> Rb-> Tb,没有死锁。 但是,如果Tb持有Rb并且需要Ra,则图形将如下:Ra-> Ta-> Rb-> ...
  • 死锁意味着对I / O资源的竞争,这就是为什么它最常出现在数据库中。 如果你不正确地锁定和请求资源,并且你明确地使用线程,那么你需要关心。 但是,缓解任何问题的具体步骤取决于您访问的I / O类型。 Deadlock implies competition for an I/O resource, which is why it comes up for databases most often. If you're improperly locking and requesting resources a ...
  • 当您处理状态为“有A,需要B”而其他一些进程处于“有B,需要A”时,会发生死锁。 如果我正确地读你的表,那么这将表明一个僵局: Allocation Request Available A B C A B C A B C P0 0 1 0 1 0 0 0 0 0 P1 2 0 0 2 1 2 P0具有资源B,并且需要资源A,没有更多资源A可用 P1有2个资源A,需要源B,没有更多的B可用。 在更多资源A ...
  • Postgres只会发现死锁,如果它可以看到两个交易相互等待。 特别是对于两个(或更多)进程,场景必须是: 需要获取被B锁定的资源。 B需要获取被A锁定的资源。 死锁处理不会处理以下情况: 需要获取被B锁定的资源。 B将表锁定在交互式psql会话中,然后在没有提交,回滚或注销的情况下休息。 根据您的描述,听起来您的某个数据库会话未释放其资源。 也许它缺少一个COMMIT等。就Postgres而言,它并不是一个僵局,因为众所周知,有一个完全正确的理由,为什么锁被持有那么久。 您可以做的一件事是设置锁定超时。 ...
  • (这是一个猜想,但希望是受过教育的人。) 一切都取决于SELECT被ORID BY O_ID ... FOR UPDATE锁定行的顺序。 如果O_ID的顺序与ID的顺序不同,那么完全有可能出现类似这样的情况: ID O_ID -- ---- 1 2 2 1 事务A锁定ID = 2的行。 事务B锁定ID = 1的行。 事务A尝试锁定ID = 1的行,但强制在事务B上等待。 事务B尝试锁定ID = 2的行,但强制等待事务A. 警告:即使O_ID顺序与ID顺序相同,ORDER BY子 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)