Only block for a short time when draining hold lists.
@@ -774,7 +774,7 @@ void
AttributeVector::drain_hold(uint64_t hold_limit)
{
incGeneration();
- for (int retry = 0; ; ++retry) {
+ for (int retry = 0; retry < 40; ++retry) {
removeAllOldGenerations();
updateStat(true);
if (_status.getOnHold() <= hold_limit) {
@@ -788,12 +788,17 @@ void
AttributeVector::update_config(const Config& cfg)
{
commit(true);
+ bool compaction_strategy_changed = (cfg.getCompactionStrategy() != _config.getCompactionStrategy());
+ if (compaction_strategy_changed) {
drain_hold(1024 * 1024); // Wait until 1MiB or less on hold
+ }
_config.setGrowStrategy(cfg.getGrowStrategy());
_config.setCompactionStrategy(cfg.getCompactionStrategy());
- commit(); // might trigger compaction if compaction strategy changed
+ if (compaction_strategy_changed) {
+ commit(); // might trigger compaction
drain_hold(1024 * 1024); // Wait until 1MiB or less on hold
}
+}
template bool AttributeVector::append<StringChangeData>(ChangeVectorT< ChangeTemplate<StringChangeData> > &changes, uint32_t , const StringChangeData &, int32_t, bool);
template bool AttributeVector::update<StringChangeData>(ChangeVectorT< ChangeTemplate<StringChangeData> > &changes, uint32_t , const StringChangeData &);
