Browse Source

[2833] refactoring: create ZoneTableSegment per data source.

in fact, we shouldn't have shared the same segment even before; the header
part should be created per data source.  So this is actually a bug fix.
JINMEI Tatuya 12 years ago
parent
commit
905f265367
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/lib/datasrc/client_list.cc

+ 6 - 2
src/lib/datasrc/client_list.cc

@@ -94,8 +94,6 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
     size_t i(0); // Outside of the try to be able to access it in the catch
     try {
         vector<DataSourceInfo> new_data_sources;
-        shared_ptr<ZoneTableSegment> ztable_segment(
-            ZoneTableSegment::create(*config, rrclass_));
         set<string> used_names;
         for (; i < config->size(); ++i) {
             // Extract the parameters
@@ -121,6 +119,12 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
                           << name);
             }
 
+            shared_ptr<ZoneTableSegment> ztable_segment;
+            if (want_cache) {
+                ztable_segment.reset(ZoneTableSegment::create(*config,
+                                                              rrclass_));
+            }
+
             if (type == "MasterFiles") {
                 // In case the cache is not allowed, we just skip the master
                 // files (at least for now)