Kindly, check for which specific indexes and for which bucket directories it is giving the error.
Generally, whenever an index generates too many small tsidx files(more than 25) Splunk is not able to optimize all those files within the specified time period.
Kindly, run the below command against the specific directory to optimize it manually:-
splunk-optimize -d|--directory
Or you can make the below changes in Indexes.conf to fix the issue:-
indexes.conf
[default]
maxConcurrentOptimizes=25
maxRunningProcessGroups=12
processTrackerServiceInterval=0
Please go through the below documentation to have a better understanding of Splunk Optimization.
http://docs.splunk.com/Documentation/Splunk/latest/Indexer/Optimizeindexes
... View more