aboutsummaryrefslogtreecommitdiffstats
path: root/searchcorespi
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-03-17 11:13:24 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-03-17 11:13:24 +0000
commit4e6777f02b47a9da44ea7b86cd58cb88fb93f253 (patch)
treeb91b958db826f42b1eaeb858225fceaf8880fba2 /searchcorespi
parentb09d7deb64e5a723c5a052dd2b1db225f632405f (diff)
Remove union based fusion schema. It was used to keep data for removed
indexed fields in old documents intact until history was wiped, in case the user wanted to revert the config change.
Diffstat (limited to 'searchcorespi')
-rw-r--r--searchcorespi/src/tests/plugin/plugin.cpp2
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h9
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp15
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h7
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp2
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h12
6 files changed, 7 insertions, 40 deletions
diff --git a/searchcorespi/src/tests/plugin/plugin.cpp b/searchcorespi/src/tests/plugin/plugin.cpp
index ecd8cc892d9..0ebd22495f8 100644
--- a/searchcorespi/src/tests/plugin/plugin.cpp
+++ b/searchcorespi/src/tests/plugin/plugin.cpp
@@ -34,7 +34,7 @@ public:
searchcorespi::IFlushTarget::List l;
return l;
}
- virtual void setSchema(const Schema & , const Schema &) { }
+ virtual void setSchema(const Schema &) { }
virtual void wipeHistory(SerialNum , const Schema &) { }
};
diff --git a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
index e774629c787..b1e3e5515b5 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
@@ -152,16 +152,11 @@ public:
virtual IFlushTarget::List getFlushTargets() = 0;
/**
- * Sets the new schema and new fusion schema to be used by this index manager.
- * The fusion schema is the union of the new schema and the history schema.
- * The history schema keeps track of removed fields that have not been completely wiped yet.
- * By using the fusion schema during fusion we ensure that removed fields are taken into the
- * fusioned disk index to support the case where they are later re-applied.
+ * Sets the new schema to be used by this index manager.
*
* @param schema The new schema to start using.
- * @param fusionSchema The new fusion schema to start using.
**/
- virtual void setSchema(const Schema &schema, const Schema &fusionSchema) = 0;
+ virtual void setSchema(const Schema &schema) = 0;
/**
* Wipes remains of removed fields from this index manager as specified in the history schema.
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
index 5590169fbef..ce88cc1188b 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -732,7 +732,6 @@ IndexMaintainer::doneSetSchema(SetSchemaArgs &args, IMemoryIndex::SP &newIndex)
LockGuard state_lock(_state_lock);
typedef FixedSourceSelector::SaveInfo SaveInfo;
args._oldSchema = _schema; // Delay destruction
- args._oldFusionSchema = _fusionSchema;
args._oldIndex = _current_index; // Delay destruction
args._oldSourceList = _source_list; // Delay destruction
uint32_t oldAbsoluteId = _current_index_id + _last_fusion_id;
@@ -745,7 +744,6 @@ IndexMaintainer::doneSetSchema(SetSchemaArgs &args, IMemoryIndex::SP &newIndex)
{
LockGuard lock(_index_update_lock);
_schema = args._newSchema;
- _fusionSchema = args._newFusionSchema;
if (!_current_index->hasReceivedDocumentInsert()) {
dropEmptyLast = true; // Skip flush of empty memory index
}
@@ -829,7 +827,6 @@ IndexMaintainer::IndexMaintainer(const IndexMaintainerConfig &config,
_active_indexes(new ActiveDiskIndexes()),
_layout(config.getBaseDir()),
_schema(config.getSchema()),
- _fusionSchema(config.getFusionSchema()),
_activeFusionSchema(),
_activeFusionWipeTimeSchema(),
_source_selector_changes(0),
@@ -994,9 +991,9 @@ IndexMaintainer::runFusion(const FusionSpec &fusion_spec)
{
LockGuard slock(_state_lock);
LockGuard ilock(_index_update_lock);
- _activeFusionSchema.reset(new Schema(_fusionSchema));
+ _activeFusionSchema.reset(new Schema(_schema));
_activeFusionWipeTimeSchema.reset();
- args._schema = _fusionSchema;
+ args._schema = _schema;
}
FastOS_StatInfo statInfo;
string lastFlushDir(getFlushDir(fusion_spec.flush_ids.back()));
@@ -1207,14 +1204,13 @@ IndexMaintainer::getFlushTargets(void)
}
void
-IndexMaintainer::setSchema(const Schema & schema, const Schema & fusionSchema)
+IndexMaintainer::setSchema(const Schema & schema)
{
assert(_ctx.getThreadingService().master().isCurrentThread());
IMemoryIndex::SP new_index(_operations.createMemoryIndex(schema, _current_serial_num));
SetSchemaArgs args;
args._newSchema = schema;
- args._newFusionSchema = fusionSchema;
scheduleCommit();
// Ensure that all index thread tasks accessing memory index have completed.
_ctx.getThreadingService().sync();
@@ -1228,11 +1224,6 @@ void
IndexMaintainer::wipeHistory(SerialNum wipeSerial, const Schema &historyFields)
{
assert(_ctx.getThreadingService().master().isCurrentThread());
- {
- LockGuard state_lock(_state_lock);
- LockGuard lock(_index_update_lock);
- _fusionSchema = _schema;
- }
for (;;) {
const Schema before_schema = getSchema();
IIndexCollection::SP before_coll = getSourceCollection();
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
index 5c2bc30dae7..c3cacd2cb25 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
@@ -89,7 +89,6 @@ class IndexMaintainer : public IIndexManager,
ActiveDiskIndexes::SP _active_indexes;
IndexDiskLayout _layout;
Schema _schema; // Protected by SL + IUL
- Schema _fusionSchema; // Protected by SL + IUL
Schema::SP _activeFusionSchema; // Protected by SL + IUL
// Protected by SL + IUL
Schema::SP _activeFusionWipeTimeSchema;
@@ -258,17 +257,13 @@ class IndexMaintainer : public IIndexManager,
{
public:
Schema _newSchema;
- Schema _newFusionSchema;
Schema _oldSchema;
- Schema _oldFusionSchema;
IMemoryIndex::SP _oldIndex;
ISearchableIndexCollection::SP _oldSourceList; // Delays destruction
SetSchemaArgs(void)
: _newSchema(),
- _newFusionSchema(),
_oldSchema(),
- _oldFusionSchema(),
_oldIndex(),
_oldSourceList()
{ }
@@ -400,7 +395,7 @@ public:
}
IFlushTarget::List getFlushTargets() override;
- void setSchema(const Schema & schema, const Schema & fusionSchema) override ;
+ void setSchema(const Schema & schema) override ;
void wipeHistory(SerialNum wipeSerial, const Schema &historyFields) override;
};
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp
index 3041de1a950..bb9bed17360 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.cpp
@@ -15,13 +15,11 @@ IndexMaintainerConfig::IndexMaintainerConfig(const vespalib::string &baseDir,
const WarmupConfig & warmup,
size_t maxFlushed,
const Schema &schema,
- const Schema &fusionSchema,
const TuneFileAttributes &tuneFileAttributes)
: _baseDir(baseDir),
_warmup(warmup),
_maxFlushed(maxFlushed),
_schema(schema),
- _fusionSchema(fusionSchema),
_tuneFileAttributes(tuneFileAttributes)
{
}
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h
index 227141ee2dd..9176ae1fd31 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainerconfig.h
@@ -18,7 +18,6 @@ private:
const WarmupConfig _warmup;
const size_t _maxFlushed;
const search::index::Schema _schema;
- const search::index::Schema _fusionSchema;
const search::TuneFileAttributes _tuneFileAttributes;
public:
@@ -26,7 +25,6 @@ public:
const WarmupConfig & warmup,
size_t maxFlushed,
const search::index::Schema &schema,
- const search::index::Schema &fusionSchema,
const search::TuneFileAttributes &tuneFileAttributes);
/**
@@ -46,16 +44,6 @@ public:
}
/**
- * Returns the initial fusion schema containing all index fields that has been in the system.
- * This includes all current fields and removed fields that has not been wiped yet.
- * This schema is used during fusion to make sure that removed fields are transferred into the
- * fusioned index in case they are re-introduced later on.
- */
- const search::index::Schema &getFusionSchema() const {
- return _fusionSchema;
- }
-
- /**
* Returns the specification on how to read/write attribute vector data files.
*/
const search::TuneFileAttributes &getTuneFileAttributes() const {