You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Gael Jourdan-Weil <ga...@kelkoogroup.com> on 2020/07/22 19:39:26 UTC
tlog keeps growing
Hello,
I'm facing a situation where a transaction log file keeps growing and is never deleted.
The setup is as follow:
- Solr 8.4.1
- SolrCloud with 2 nodes
- 1 collection, 1 shard
On one of the node I can see the tlog files having the expected behavior, that is new tlog files being created and old ones being deleted at a frequency that matches the autocommit settings.
For instance, there is currently two files tlog.0000000000000003226 and tlog.0000000000000003227, each of them is around 1G (size).
But on the other node, I see two files tlog.0000000000000000298 and tlog.0000000000000000299, the later being now 20G and has been created 10 hours ago.
It already happened a few times, restarting the server seems to make things go right but it's obviously not a durable solution.
Do you have any idea what could cause this behavior?
solrconfig.xml:
<updateHandler class="solr.DirectUpdateHandler2">
<updateLog>
<str name="dir">${solr.ulog.dir:}</str>
<int name="numRecordsToKeep">1000</int>
<int name="maxNumLogsToKeep">100</int>
</updateLog>
<autoCommit>
<maxTime>900000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<autoSoftCommit>
<maxTime>180000</maxTime>
</autoSoftCommit>
</updateHandler>
Kind regards,
Gaël
Re: tlog keeps growing
Posted by mmb1234 <mb...@vmware.com>.
Erik,
Looks like we're also running into this issue.
https://www.mail-archive.com/solr-user@lucene.apache.org/msg153798.html
Is there any think we can do to remedy this besides a node restart, which
causes leader re-election on the good shards which causes them to also
become un-operational?
--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: tlog keeps growing
Posted by Erick Erickson <er...@gmail.com>.
Gaël:
Many thanks for your writeup. I preserved your and Carlos’ comments in a JIRA: https://issues.apache.org/jira/browse/SOLR-14679.
How fast you bring the nodes up and down shouldn’t really matter, but if pausing between bouncing nodes when doing a rolling upgrade keeps you from having operational problems, then it’s the lesser of two evils.
Carlos:
Killing Solr forcefully can be problematic, that makes it much more likely that you’ll replay tlogs and trigger this problem. Mind you this is a real problem and being patient on shutdown is a band-aid… If it fits for you operationally and can
1> stop ingesting
2> insure a hard commit happens before shutdown
then you should avoid a lot of this and shutdown should be very quick. We changed bin/solr to wait up to 180 seconds rather than 10 because “kill -9" was causing problems. I realize it’s not always possible to control. It’s kind of a pay-me-now-or-pay-me-later situation, the time saved killing Solr may be more than used up buy startup later. IIRC, failed leader elections were also more frequent with SIGKILL
Best,
Erick
> On Jul 24, 2020, at 5:52 AM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>
> I think I've come down to the root cause of this mess in our case.
>
> Everything is confirming that the TLOG state is "BUFFERING" rather than "ACTIVE".
> 1/ This can be seen with the metrics API as well where we observe:
> "TLOG.replay.remaining.bytes":48997506,
> "TLOG.replay.remaining.logs":1,
> "TLOG.state":1,
> 2/ When a hard commit occurs, we can see it in the logs and as the index files are updated ; but we can also see that postCommit and preCommit UpdateLog methods are called but exits immediately which looking at the code indicates the state is "BUFFERING".
>
> So, why is this TLOG still in "BUFFERING" state?
>
> From the code, the only place where state is set to "BUFFERING" seems to be UpdateLog.bufferUpdates.
> From the logs, in our case it comes from recovery process. We see the message "Begin buffering updates. core=[col_blue_shard1]".
> Just after we can see "Publishing state of core [col_blue_shard1] as recovering, leader is [http://srv2/solr/col_blue_shard1/] and I am [http://srv1/solr/col_blue_shard1/]".
>
> Until here, everything is expected I guess but why the TLOG state is not set to "ACTIVE" a bit later?
>
> Well, the "Begin buffering updates" occured and 500ms later we can see:
> - "Updated live nodes from ZooKeeper... (2) -> (1)" (I think at this time we shut down srv2, this is our main cause of problem)
> - "I am going to be the leader srv1"
> - "Stopping recovery for core=[col_blue_shard1] coreNodeName=[core_node1]"
> And 2s later:
> - "Attempting to PeerSync from [http://srv2/solr/es_blue_shard1/] - recoveringAfterStartup=[true]"
> - "Error while trying to recover. core=es_blue_shard1:org.apache.solr.common.SolrException: Failed to get fingerprint from leader"
> - "Finished recovery process, successful=[false]"
>
> At this point, I think the root cause on our side is a rolling update that we did too quickly: we stopped node2 while node1 while recovering from it.
>
> It's still not clear how everything went back to "active" state after such a failed recovery and a TLOG still in "BUFFERING".
>
> We shouldn't have been in recovery in the first place and I think we know why, this is a first thing that we have adressed.
> Then we need to add some pauses in our rolling update strategy.
>
> Does it makes sense? Can you think of something else to check/improve?
>
> Best Regards,
> Gaël
RE: tlog keeps growing
Posted by Gael Jourdan-Weil <ga...@kelkoogroup.com>.
I think I've come down to the root cause of this mess in our case.
Everything is confirming that the TLOG state is "BUFFERING" rather than "ACTIVE".
1/ This can be seen with the metrics API as well where we observe:
"TLOG.replay.remaining.bytes":48997506,
"TLOG.replay.remaining.logs":1,
"TLOG.state":1,
2/ When a hard commit occurs, we can see it in the logs and as the index files are updated ; but we can also see that postCommit and preCommit UpdateLog methods are called but exits immediately which looking at the code indicates the state is "BUFFERING".
So, why is this TLOG still in "BUFFERING" state?
From the code, the only place where state is set to "BUFFERING" seems to be UpdateLog.bufferUpdates.
From the logs, in our case it comes from recovery process. We see the message "Begin buffering updates. core=[col_blue_shard1]".
Just after we can see "Publishing state of core [col_blue_shard1] as recovering, leader is [http://srv2/solr/col_blue_shard1/] and I am [http://srv1/solr/col_blue_shard1/]".
Until here, everything is expected I guess but why the TLOG state is not set to "ACTIVE" a bit later?
Well, the "Begin buffering updates" occured and 500ms later we can see:
- "Updated live nodes from ZooKeeper... (2) -> (1)" (I think at this time we shut down srv2, this is our main cause of problem)
- "I am going to be the leader srv1"
- "Stopping recovery for core=[col_blue_shard1] coreNodeName=[core_node1]"
And 2s later:
- "Attempting to PeerSync from [http://srv2/solr/es_blue_shard1/] - recoveringAfterStartup=[true]"
- "Error while trying to recover. core=es_blue_shard1:org.apache.solr.common.SolrException: Failed to get fingerprint from leader"
- "Finished recovery process, successful=[false]"
At this point, I think the root cause on our side is a rolling update that we did too quickly: we stopped node2 while node1 while recovering from it.
It's still not clear how everything went back to "active" state after such a failed recovery and a TLOG still in "BUFFERING".
We shouldn't have been in recovery in the first place and I think we know why, this is a first thing that we have adressed.
Then we need to add some pauses in our rolling update strategy.
Does it makes sense? Can you think of something else to check/improve?
Best Regards,
Gaël
Re: tlog keeps growing
Posted by Carlos Ugarte <cu...@gmail.com>.
Hello folks,
We see similar behavior from time to time. The main difference seems to be
that you see it while using NRT replication and we see it while using TLOG
replication.
* Solr 7.5.0.
* 1 collection with 12 shards, each with 2 TLOG and 2 PULL replicas.
* 12 machines, each machine hosting one node/JVM. Each node contains 4
replicas (different shards).
* No explicit commits in the update requests. AutoCommit=15s,
AutoSoftCommit=1s.
The symptoms we observe are as follows:
* It's on a TLOG replica that is not currently the leader.
* For that replica, there is a single transaction log that keeps on growing.
* For that replica, new segments are not being fetched from that shard's
TLOG leader.
In this configuration, one node contains four TLOG cores. We have observed
the problem occurring on a single one of the cores as well as on multiple
cores in one node.
Anecdotally, it seems to occur more frequently on those collections that
are large (number of documents, size on disk) and that have a higher ingest
rate. These are vague terms and I don't know that I'm allowed to share
specifics, but I can say that we run a number of different clouds with a
similar setup and that this problem occurs more frequently for the more
loaded clouds.
Initially we couldn't tell that this was occurring (queries were directed
to PULL replicas so not evident to the applications, the TLOG cores with
this problem reported as active and in a good state so nothing obviously
wrong). Our early alarm system now consists of checking for large
transaction logs. When we see this, we restart the problem node. Upon
restart it recovers from its leader (fetching whatever segments it had
missed - hours, days, ...). Eventually the large transaction log
disappears and that core starts to cycle through a series of smaller
transaction logs (the normal behavior).
We noticed that the ctime of the large transaction log seemed to be
slightly later than that node's restart time. After that discovery, we saw
the following pattern every time we observed the problem:
* Everything is in a good state at the beginning. A is a node containing a
TLOG replica that is leader for its shard and B is a node containing a TLOG
replica that is not a leader. Ingest is ongoing.
* A is stopped for a short period of time (< 30s) and then is started up
again. If it makes a difference, our way of stopping this relies on
systemd's default behavior - send SIGTERM, wait for 5s, send SIGKILL.
* The TLOG replica in B emerges from this as the leader for its shard.
Everything about B appears to suggest B is operating correctly. The TLOG
replica in A has the ever-growing transaction log and never fetches new
segments.
* The malfunctioning TLOG replica in A can be "fixed" by restarting A.
* As noted earlier, this can affect cores (in a single node) individually.
It can be a problem for one and not the others (or for all of the cores in
a node).
It was suggested to us that this might be
https://issues.apache.org/jira/browse/SOLR-13486.
On Wed, Jul 22, 2020 at 3:42 PM Gael Jourdan-Weil <
gael.jourdan-weil@kelkoogroup.com> wrote:
> Hello,
>
> I'm facing a situation where a transaction log file keeps growing and is
> never deleted.
>
> The setup is as follow:
> - Solr 8.4.1
> - SolrCloud with 2 nodes
> - 1 collection, 1 shard
>
> On one of the node I can see the tlog files having the expected behavior,
> that is new tlog files being created and old ones being deleted at a
> frequency that matches the autocommit settings.
> For instance, there is currently two files tlog.0000000000000003226 and
> tlog.0000000000000003227, each of them is around 1G (size).
>
> But on the other node, I see two files tlog.0000000000000000298 and
> tlog.0000000000000000299, the later being now 20G and has been created 10
> hours ago.
>
> It already happened a few times, restarting the server seems to make
> things go right but it's obviously not a durable solution.
>
> Do you have any idea what could cause this behavior?
>
> solrconfig.xml:
> <updateHandler class="solr.DirectUpdateHandler2">
> <updateLog>
> <str name="dir">${solr.ulog.dir:}</str>
> <int name="numRecordsToKeep">1000</int>
> <int name="maxNumLogsToKeep">100</int>
> </updateLog>
> <autoCommit>
> <maxTime>900000</maxTime>
> <openSearcher>false</openSearcher>
> </autoCommit>
> <autoSoftCommit>
> <maxTime>180000</maxTime>
> </autoSoftCommit>
> </updateHandler>
>
> Kind regards,
> Gaël
>
>
Re: tlog keeps growing
Posted by Walter Underwood <wu...@wunderwood.org>.
This is a long shot, but look in the overseer queue to see if stuff is stuck. We ran into that with 6.x.
We restarted the instance that was the overseer and the newly-elected overseer cleared the queue.
wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/ (my blog)
> On Jul 23, 2020, at 10:43 AM, Erick Erickson <er...@gmail.com> wrote:
>
> Yes, you should have seen a new tlog after:
> - a doc was indexed
> - 15 minutes had passed
> - another doc was indexed
>
> Well, yes, a leader can be in recovery. It looks like this:
>
> - You’re indexing and docs are written to the tlog.
> - Solr un-gracefully shuts down so the segments haven’t been closed. Note, these are thrown away on restart.
> - Solr is restarted and starts replaying the tlog.
>
> But, the node shouldn’t be active during this time.
>
> Of course it’s possible that for some strange reason, the tlog gets set to the buffering state and never gets back to active, which is what the message you posted seems to be indicating.
>
> So I’m puzzled, let us know what you find…
>
> Erick
>
>> On Jul 23, 2020, at 12:56 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>>
>>> Note that for my previous e-mail you’d have to wait 15 minutes after you started indexing to see a new tlog and also wait until at least 1,000 new document after _that_ before the large tlog went away. I don't think that’s your issue though.
>> Indeed I did wait 15 minutes but not sure 1000 documents were indexed in the meantime. Though I should've seen a new tlog even if the large one was still there, right?
>>
>>> So I think that’s the place to focus. Did the node recover completely and go active? Just checking the admin UI and seeing it be green is sometimes not enough. Check the state.json znode and see if the state is also “active” there.
>> On ZooKeeper (through the Solr UI or directly connecting to ZK) I can see "state":"active" in the state.json. This seems fine.
>> To be more weird, this is the leader node. Can a leader be in recovery??
>>
>>> Next, try sending a request directly to that replica. Frankly I’m not sure what to expect, but if you get something weird that’d be a “smoking gun” that no matter what the admin UI says, the replica isn’t really active. Something like “http://blah blah blah/solr/collection1_shard1_replica_n1?q=some_query&distrib=false. The “distrib=false” is important, otherwise the request will be forwarded to a truly active node.
>> The request works fine, I don't see anything weird at that time in the logs.
>>
>> I will investigate further and take a look at all what you mentionned.
>>
>> Kind regards,
>> Gaël
>
Re: tlog keeps growing
Posted by Erick Erickson <er...@gmail.com>.
Yes, you should have seen a new tlog after:
- a doc was indexed
- 15 minutes had passed
- another doc was indexed
Well, yes, a leader can be in recovery. It looks like this:
- You’re indexing and docs are written to the tlog.
- Solr un-gracefully shuts down so the segments haven’t been closed. Note, these are thrown away on restart.
- Solr is restarted and starts replaying the tlog.
But, the node shouldn’t be active during this time.
Of course it’s possible that for some strange reason, the tlog gets set to the buffering state and never gets back to active, which is what the message you posted seems to be indicating.
So I’m puzzled, let us know what you find…
Erick
> On Jul 23, 2020, at 12:56 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>
>> Note that for my previous e-mail you’d have to wait 15 minutes after you started indexing to see a new tlog and also wait until at least 1,000 new document after _that_ before the large tlog went away. I don't think that’s your issue though.
> Indeed I did wait 15 minutes but not sure 1000 documents were indexed in the meantime. Though I should've seen a new tlog even if the large one was still there, right?
>
>> So I think that’s the place to focus. Did the node recover completely and go active? Just checking the admin UI and seeing it be green is sometimes not enough. Check the state.json znode and see if the state is also “active” there.
> On ZooKeeper (through the Solr UI or directly connecting to ZK) I can see "state":"active" in the state.json. This seems fine.
> To be more weird, this is the leader node. Can a leader be in recovery??
>
>> Next, try sending a request directly to that replica. Frankly I’m not sure what to expect, but if you get something weird that’d be a “smoking gun” that no matter what the admin UI says, the replica isn’t really active. Something like “http://blah blah blah/solr/collection1_shard1_replica_n1?q=some_query&distrib=false. The “distrib=false” is important, otherwise the request will be forwarded to a truly active node.
> The request works fine, I don't see anything weird at that time in the logs.
>
> I will investigate further and take a look at all what you mentionned.
>
> Kind regards,
> Gaël
RE: tlog keeps growing
Posted by Gael Jourdan-Weil <ga...@kelkoogroup.com>.
> Note that for my previous e-mail you’d have to wait 15 minutes after you started indexing to see a new tlog and also wait until at least 1,000 new document after _that_ before the large tlog went away. I don't think that’s your issue though.
Indeed I did wait 15 minutes but not sure 1000 documents were indexed in the meantime. Though I should've seen a new tlog even if the large one was still there, right?
> So I think that’s the place to focus. Did the node recover completely and go active? Just checking the admin UI and seeing it be green is sometimes not enough. Check the state.json znode and see if the state is also “active” there.
On ZooKeeper (through the Solr UI or directly connecting to ZK) I can see "state":"active" in the state.json. This seems fine.
To be more weird, this is the leader node. Can a leader be in recovery??
> Next, try sending a request directly to that replica. Frankly I’m not sure what to expect, but if you get something weird that’d be a “smoking gun” that no matter what the admin UI says, the replica isn’t really active. Something like “http://blah blah blah/solr/collection1_shard1_replica_n1?q=some_query&distrib=false. The “distrib=false” is important, otherwise the request will be forwarded to a truly active node.
The request works fine, I don't see anything weird at that time in the logs.
I will investigate further and take a look at all what you mentionned.
Kind regards,
Gaël
Re: tlog keeps growing
Posted by Erick Erickson <er...@gmail.com>.
Hmmm, now we’re getting somewhere. Here’s the code block in DistributedUpdateProcessor
if (ulog == null || ulog.getState() == UpdateLog.State.ACTIVE || (cmd.getFlags() & UpdateCommand.REPLAY) != 0) {
super.processCommit(cmd);
} else {
if (log.isInfoEnabled()) {
log.info("Ignoring commit while not ACTIVE - state: {} replay: {}"
, ulog.getState(), ((cmd.getFlags() & UpdateCommand.REPLAY) != 0));
}
}
Why you’re buffering is the mystery.
Note that for my previous e-mail you’d have to wait 15 minutes after you started indexing to see a new tlog and also wait until at least 1,000 new document after _that_ before the large tlog went away. I don't think that’s your issue though.
On a _very_ quick look at the code (and this is not code I’m intimately familiar with), the only time the state should be BUFFERING is if the node is in recovery. Once recovery is complete, the tlog state should change.
So I think that’s the place to focus. Did the node recover completely and go active? Just checking the admin UI and seeing it be green is sometimes not enough. Check the state.json znode and see if the state is also “active” there.
Next, try sending a request directly to that replica. Frankly I’m not sure what to expect, but if you get something weird that’d be a “smoking gun” that no matter what the admin UI says, the replica isn’t really active. Something like “http://blah blah blah/solr/collection1_shard1_replica_n1?q=some_query&distrib=false. The “distrib=false” is important, otherwise the request will be forwarded to a truly active node.
I’d tail the log on that replica at the same time to gather clues.
Your Solr log should also indicate that the replica went into recovery and, eventually, completed. The scenario seems to be that
- the replica goes into recovery
- the replica either never catches up _or_ it would eventually catch up but is processing so much data that it just seems like it’s stuck.
If the replica never catches up, especially if you slow down/stop indexing, that’s certainly a bug. In days long ago the tlog replay could be very inefficient, but that hasn’t been the case since well before 8.4. Regressions are always possible of course.
Since it’s expected that the tlog will grow until recovery is complete, it feels like this is somewhat on the right track.
You should see some message at WARN level like
"Starting log replay…” and "Log replay finished…”
and INFO level messages every 1,000 docs replayed like
"log replay status…"
I’d be grepping my log for anything that mentions “replay” (case-insensitive!) If you’re interested in code spelunking, see LogReplayer, run and doReplay in UpdateLog.java are where you can find the messages I’d epect to see in the log.
If you want to enable DEBUG level for UpdateLog.java you’ll see info about the individual entries from the tlog that are replayed, but I’d only go there if the progress every 1,000 docs doesn’t show anything useful.
Good Luck!
Erick
> On Jul 23, 2020, at 10:03 AM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>
> Ignoring commit while not ACTIVE - state: BUFFERING
RE: tlog keeps growing
Posted by Gael Jourdan-Weil <ga...@kelkoogroup.com>.
Thanks for all the details.
Everytime I go back to this article and everytime I learn something new (or should I say I remember something that I had forgotten!).
The scenario you are describing could match our experience except the last step "you stop indexing entirely and the tlog never gets rotated".
It's very likely that we stopped indexing for a significant amount of time (maybe ~1hour) but after I'm quite sure that there was some indexation going on at a lower rate and this didn't trigger anything.
Sorry if I'm not answering some of your questions, I'm trying to reproduce and test some stuff before giving some definitive answers and apply your suggestions.
I can give you some additionals info though:
- We are working with quite small documents (<5KB)
- On a node that is currently having the issue, I tried to force a commit (http://.../update?commit=true) and nothing is happening from the tlog POV: it still is very large and constantly growing.
I put the logs in DEBUG through the Solr UI and grepped "commit" at the time of the forced commit and here's what we have:
"method": "processCommit",
"message": "PRE_UPDATE commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false} {commit=true&update.chain=files-update-processor&df=_text_}",
"method": "distribCommit",
"message": "Distrib commit to: [] params: update.chain=files-update-processor&update.distrib=TOLEADER&commit_end_point=leaders&distrib.from=http://srv1:8083/solr/col_blue_shard1/",
"method": "distribCommit",
"message": "Distrib commit to: [StdNode: http://srv2:8083/solr/col_blue_shard1/] params: update.chain=files-update-processor&update.distrib=FROMLEADER&commit_end_point=replicas&distrib.from=http://srv2:8083/solr/col_blue_shard1/",
"message": "sending update to http://srv2:8083/solr/col_blue_shard1/ retry:0 commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false} params:update.chain=files-update-processor&update.distrib=FROMLEADER&commit_end_point=replicas&distrib.from=http://srv1:8083/solr/col_blue_shard1/&commit=true&softCommit=false&waitSearcher=true&expungeDeletes=false&openSearcher=true",
"method": "doLocalCommit",
"message": "Ignoring commit while not ACTIVE - state: BUFFERING replay: false",
"message": "PRE_UPDATE FINISH {commit=true&update.chain=files-update-processor&df=_text_}",
"message": "[col_blue_shard1] webapp=/shoppingfeedses path=/update params={commit=true}{commit=} 0 119",
"message": "Closing out SolrRequest: {commit=true&update.chain=files-update-processor&df=_text_}",
"Ignoring commit while not ACTIVE" feels strange but maybe It's doesn't mean what I think it means.
Do you see something strange in there?
Kind regards,
Gaël
De : Erick Erickson <er...@gmail.com>
Envoyé : jeudi 23 juillet 2020 13:52
À : solr-user@lucene.apache.org <so...@lucene.apache.org>
Objet : Re: tlog keeps growing
Hmmm, this doesn't account for the tlog growth, but a 15 minute hard
commit is excessive and accounts for your down time on restart if Solr
is forcefully shut down. I’d shorten it to a minute or less. You also
shouldn’t have any replay if you shut down your Solr gracefully.
Here’s lots of background:
https://lucidworks.com/post/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/
It is _vaguely_ possible (and I’m really reaching here) that if you’re indexing at a
rapid rate when you start Solr. Here’s the scenario:
- Solr un-gracefully shuts down
- you start Solr and it starts replaying the tlog
- more documents come in and are, guess what, written to the tlog
- the tlog grows as long as this goes on.
- you stop indexing entirely and the tlog never gets rotated.
I consider this unlikely-but-possible. One implication here is that it is _not_
a requirement that a replica be “active” to start accumulating docs in the
tlog, they certainly can grow when a replica is recovering. There should also
be messages about starting tlog replay (although I don’t remember the
exact wording).
When you shut Solr down, do you get any message on the screen about
“forcefully killing Solr”? If so, the tlog gets replayed on startup. This shouldn’t
happen and if it is it’d be good to find out why...
Also note that the contract is that enough closed tlogs are kept around to
satisfy numRecordsToKeep. So in this scenario, your large tlog will remain
until enough _new_ tlogs are created to contain over 1,000 documents.
What none of this really explains is why the tlog goes away on restart.
Does it disappear immediately or does it disappear after a while (i.e.
after you index another 1,000 documents and it can be rolled off)?
BTW, numRecordsToKeep really only is useful for “peer sync”. If a follower
needs to recover and there are enough records in the tlog to catch it up
from when it started to recover, the records are sent from the tlog
rather than the full index replicating. If you’re not getting replicas going
into recovery (except of course on startup), this isn’t doing you much
good and I’d reduce it (the default is 100).
Yeah, the open searcher is the soft commit. Do you see any references to
“commit” or “commitTracker”? Some of those will be the autocommit kicking
in, and there should be info in the message about whether a new searcher
is being opened, which will indicat whether it;s a hard or soft commit.
So I’d shorten your hard commit interval significantly. That shouldn’t matter, or
more correctly the large tlog should eventually clear itself out but it’ll provide
some data.
One thing to check is if, and assuming you’re indexing docs, does a new tlog
get created 15+ minutes later (and after the replica is active)? If so, I’d expect
the large tlog to be deleted 1,000 docs later.
Best,
Erick
> On Jul 22, 2020, at 4:14 PM, Erick Erickson <er...@gmail.com> wrote:
>
> I’m assuming you do not have CDCR configured, correct?
>
> This is weird. Every hard commit should close the current tlog, open a new one and delete old ones respecting numRecordsToKeep.
>
> Are these NRT replicas or TLOG replicas? That shouldn’t make a lot of difference, but might be a clue.
>
> Your solr log in the one with 20G tlogs should show commits, is there anything that points up?
>
> It’s also a bit weird that the numbers are so very different. While not lock-step, I’d expect that they were reasonably close. When you restart the server, does Solr roll over the logs for some period or does it just start accumulating the tlog?
>
> Are both replicas in the “active” state? And is the replica with the large tlogs the follower or the leader?
>
> Mainly asking a bunch of questions because I haven’t seen this happen, the answers to the above might give a clue where to look next.
>
> Best,
> Erick
>
>> On Jul 22, 2020, at 3:39 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>>
>> Hello,
>>
>> I'm facing a situation where a transaction log file keeps growing and is never deleted.
>>
>> The setup is as follow:
>> - Solr 8.4.1
>> - SolrCloud with 2 nodes
>> - 1 collection, 1 shard
>>
>> On one of the node I can see the tlog files having the expected behavior, that is new tlog files being created and old ones being deleted at a frequency that matches the autocommit settings.
>> For instance, there is currently two files tlog.0000000000000003226 and tlog.0000000000000003227, each of them is around 1G (size).
>>
>> But on the other node, I see two files tlog.0000000000000000298 and tlog.0000000000000000299, the later being now 20G and has been created 10 hours ago.
>>
>> It already happened a few times, restarting the server seems to make things go right but it's obviously not a durable solution.
>>
>> Do you have any idea what could cause this behavior?
>>
>> solrconfig.xml:
>> <updateHandler class="solr.DirectUpdateHandler2">
>> <updateLog>
>> <str name="dir">${solr.ulog.dir:}</str>
>> <int name="numRecordsToKeep">1000</int>
>> <int name="maxNumLogsToKeep">100</int>
>> </updateLog>
>> <autoCommit>
>> <maxTime>900000</maxTime>
>> <openSearcher>false</openSearcher>
>> </autoCommit>
>> <autoSoftCommit>
>> <maxTime>180000</maxTime>
>> </autoSoftCommit>
>> </updateHandler>
>>
>> Kind regards,
>> Gaël
>>
>
Re: tlog keeps growing
Posted by Erick Erickson <er...@gmail.com>.
Hmmm, this doesn't account for the tlog growth, but a 15 minute hard
commit is excessive and accounts for your down time on restart if Solr
is forcefully shut down. I’d shorten it to a minute or less. You also
shouldn’t have any replay if you shut down your Solr gracefully.
Here’s lots of background:
https://lucidworks.com/post/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/
It is _vaguely_ possible (and I’m really reaching here) that if you’re indexing at a
rapid rate when you start Solr. Here’s the scenario:
- Solr un-gracefully shuts down
- you start Solr and it starts replaying the tlog
- more documents come in and are, guess what, written to the tlog
- the tlog grows as long as this goes on.
- you stop indexing entirely and the tlog never gets rotated.
I consider this unlikely-but-possible. One implication here is that it is _not_
a requirement that a replica be “active” to start accumulating docs in the
tlog, they certainly can grow when a replica is recovering. There should also
be messages about starting tlog replay (although I don’t remember the
exact wording).
When you shut Solr down, do you get any message on the screen about
“forcefully killing Solr”? If so, the tlog gets replayed on startup. This shouldn’t
happen and if it is it’d be good to find out why...
Also note that the contract is that enough closed tlogs are kept around to
satisfy numRecordsToKeep. So in this scenario, your large tlog will remain
until enough _new_ tlogs are created to contain over 1,000 documents.
What none of this really explains is why the tlog goes away on restart.
Does it disappear immediately or does it disappear after a while (i.e.
after you index another 1,000 documents and it can be rolled off)?
BTW, numRecordsToKeep really only is useful for “peer sync”. If a follower
needs to recover and there are enough records in the tlog to catch it up
from when it started to recover, the records are sent from the tlog
rather than the full index replicating. If you’re not getting replicas going
into recovery (except of course on startup), this isn’t doing you much
good and I’d reduce it (the default is 100).
Yeah, the open searcher is the soft commit. Do you see any references to
“commit” or “commitTracker”? Some of those will be the autocommit kicking
in, and there should be info in the message about whether a new searcher
is being opened, which will indicat whether it;s a hard or soft commit.
So I’d shorten your hard commit interval significantly. That shouldn’t matter, or
more correctly the large tlog should eventually clear itself out but it’ll provide
some data.
One thing to check is if, and assuming you’re indexing docs, does a new tlog
get created 15+ minutes later (and after the replica is active)? If so, I’d expect
the large tlog to be deleted 1,000 docs later.
Best,
Erick
> On Jul 22, 2020, at 4:14 PM, Erick Erickson <er...@gmail.com> wrote:
>
> I’m assuming you do not have CDCR configured, correct?
>
> This is weird. Every hard commit should close the current tlog, open a new one and delete old ones respecting numRecordsToKeep.
>
> Are these NRT replicas or TLOG replicas? That shouldn’t make a lot of difference, but might be a clue.
>
> Your solr log in the one with 20G tlogs should show commits, is there anything that points up?
>
> It’s also a bit weird that the numbers are so very different. While not lock-step, I’d expect that they were reasonably close. When you restart the server, does Solr roll over the logs for some period or does it just start accumulating the tlog?
>
> Are both replicas in the “active” state? And is the replica with the large tlogs the follower or the leader?
>
> Mainly asking a bunch of questions because I haven’t seen this happen, the answers to the above might give a clue where to look next.
>
> Best,
> Erick
>
>> On Jul 22, 2020, at 3:39 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>>
>> Hello,
>>
>> I'm facing a situation where a transaction log file keeps growing and is never deleted.
>>
>> The setup is as follow:
>> - Solr 8.4.1
>> - SolrCloud with 2 nodes
>> - 1 collection, 1 shard
>>
>> On one of the node I can see the tlog files having the expected behavior, that is new tlog files being created and old ones being deleted at a frequency that matches the autocommit settings.
>> For instance, there is currently two files tlog.0000000000000003226 and tlog.0000000000000003227, each of them is around 1G (size).
>>
>> But on the other node, I see two files tlog.0000000000000000298 and tlog.0000000000000000299, the later being now 20G and has been created 10 hours ago.
>>
>> It already happened a few times, restarting the server seems to make things go right but it's obviously not a durable solution.
>>
>> Do you have any idea what could cause this behavior?
>>
>> solrconfig.xml:
>> <updateHandler class="solr.DirectUpdateHandler2">
>> <updateLog>
>> <str name="dir">${solr.ulog.dir:}</str>
>> <int name="numRecordsToKeep">1000</int>
>> <int name="maxNumLogsToKeep">100</int>
>> </updateLog>
>> <autoCommit>
>> <maxTime>900000</maxTime>
>> <openSearcher>false</openSearcher>
>> </autoCommit>
>> <autoSoftCommit>
>> <maxTime>180000</maxTime>
>> </autoSoftCommit>
>> </updateHandler>
>>
>> Kind regards,
>> Gaël
>>
>
RE: tlog keeps growing
Posted by Gael Jourdan-Weil <ga...@kelkoogroup.com>.
Indeed no CDCR.
All NRT replicas.
In the logs of the node with the big tlog, I don't see anything that looks unusual to me.
Not sure how to see the commits though.
I can see some "Opening [Searcher@...]" logs, but these are related to the softCommit, right?
Both replicas are in "active" state right now.
I can't say for sure in which states they were when the tlog started to accumulate though but I would assume they were "active".
Replica with the large tlog is leader.
When restarting the node with the large tlog, it stays in "down" status for a while (replaying the tlog afaik).
Then it goes "active". At this stage the large tlog file is still there.
When a new document arrives, a new tlog file is created (tlog.0000000000000000301).
I don't see how it could be related but it seems to have started to accumulate when we changed some collection aliases (I said we have 1 collection, it's not entirely true: we have 2 collections and we switch to one or the other using aliases, only one is considered to be "in use" at a time).
Kind regards,
Gaël
De : Erick Erickson <er...@gmail.com>
Envoyé : mercredi 22 juillet 2020 22:14
À : solr-user@lucene.apache.org <so...@lucene.apache.org>
Objet : Re: tlog keeps growing
I’m assuming you do not have CDCR configured, correct?
This is weird. Every hard commit should close the current tlog, open a new one and delete old ones respecting numRecordsToKeep.
Are these NRT replicas or TLOG replicas? That shouldn’t make a lot of difference, but might be a clue.
Your solr log in the one with 20G tlogs should show commits, is there anything that points up?
It’s also a bit weird that the numbers are so very different. While not lock-step, I’d expect that they were reasonably close. When you restart the server, does Solr roll over the logs for some period or does it just start accumulating the tlog?
Are both replicas in the “active” state? And is the replica with the large tlogs the follower or the leader?
Mainly asking a bunch of questions because I haven’t seen this happen, the answers to the above might give a clue where to look next.
Best,
Erick
> On Jul 22, 2020, at 3:39 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>
> Hello,
>
> I'm facing a situation where a transaction log file keeps growing and is never deleted.
>
> The setup is as follow:
> - Solr 8.4.1
> - SolrCloud with 2 nodes
> - 1 collection, 1 shard
>
> On one of the node I can see the tlog files having the expected behavior, that is new tlog files being created and old ones being deleted at a frequency that matches the autocommit settings.
> For instance, there is currently two files tlog.0000000000000003226 and tlog.0000000000000003227, each of them is around 1G (size).
>
> But on the other node, I see two files tlog.0000000000000000298 and tlog.0000000000000000299, the later being now 20G and has been created 10 hours ago.
>
> It already happened a few times, restarting the server seems to make things go right but it's obviously not a durable solution.
>
> Do you have any idea what could cause this behavior?
>
> solrconfig.xml:
> <updateHandler class="solr.DirectUpdateHandler2">
> <updateLog>
> <str name="dir">${solr.ulog.dir:}</str>
> <int name="numRecordsToKeep">1000</int>
> <int name="maxNumLogsToKeep">100</int>
> </updateLog>
> <autoCommit>
> <maxTime>900000</maxTime>
> <openSearcher>false</openSearcher>
> </autoCommit>
> <autoSoftCommit>
> <maxTime>180000</maxTime>
> </autoSoftCommit>
> </updateHandler>
>
> Kind regards,
> Gaël
>
Re: tlog keeps growing
Posted by Erick Erickson <er...@gmail.com>.
I’m assuming you do not have CDCR configured, correct?
This is weird. Every hard commit should close the current tlog, open a new one and delete old ones respecting numRecordsToKeep.
Are these NRT replicas or TLOG replicas? That shouldn’t make a lot of difference, but might be a clue.
Your solr log in the one with 20G tlogs should show commits, is there anything that points up?
It’s also a bit weird that the numbers are so very different. While not lock-step, I’d expect that they were reasonably close. When you restart the server, does Solr roll over the logs for some period or does it just start accumulating the tlog?
Are both replicas in the “active” state? And is the replica with the large tlogs the follower or the leader?
Mainly asking a bunch of questions because I haven’t seen this happen, the answers to the above might give a clue where to look next.
Best,
Erick
> On Jul 22, 2020, at 3:39 PM, Gael Jourdan-Weil <ga...@kelkoogroup.com> wrote:
>
> Hello,
>
> I'm facing a situation where a transaction log file keeps growing and is never deleted.
>
> The setup is as follow:
> - Solr 8.4.1
> - SolrCloud with 2 nodes
> - 1 collection, 1 shard
>
> On one of the node I can see the tlog files having the expected behavior, that is new tlog files being created and old ones being deleted at a frequency that matches the autocommit settings.
> For instance, there is currently two files tlog.0000000000000003226 and tlog.0000000000000003227, each of them is around 1G (size).
>
> But on the other node, I see two files tlog.0000000000000000298 and tlog.0000000000000000299, the later being now 20G and has been created 10 hours ago.
>
> It already happened a few times, restarting the server seems to make things go right but it's obviously not a durable solution.
>
> Do you have any idea what could cause this behavior?
>
> solrconfig.xml:
> <updateHandler class="solr.DirectUpdateHandler2">
> <updateLog>
> <str name="dir">${solr.ulog.dir:}</str>
> <int name="numRecordsToKeep">1000</int>
> <int name="maxNumLogsToKeep">100</int>
> </updateLog>
> <autoCommit>
> <maxTime>900000</maxTime>
> <openSearcher>false</openSearcher>
> </autoCommit>
> <autoSoftCommit>
> <maxTime>180000</maxTime>
> </autoSoftCommit>
> </updateHandler>
>
> Kind regards,
> Gaël
>