rippled
ShardArchiveHandler_test.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2020 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/app/rdb/RelationalDBInterface_shards.h>
21 #include <ripple/beast/utility/temp_dir.h>
22 #include <ripple/core/ConfigSections.h>
23 #include <ripple/nodestore/DummyScheduler.h>
24 #include <ripple/nodestore/Manager.h>
25 #include <ripple/nodestore/impl/DecodedBlob.h>
26 #include <ripple/protocol/jss.h>
27 #include <ripple/rpc/ShardArchiveHandler.h>
28 #include <test/jtx/CaptureLogs.h>
29 #include <test/jtx/Env.h>
30 #include <test/jtx/TrustedPublisherServer.h>
31 #include <test/jtx/envconfig.h>
32 #include <test/nodestore/TestBase.h>
33 
34 namespace ripple {
35 namespace test {
36 
37 class ShardArchiveHandler_test : public beast::unit_test::suite
38 {
40 
42  createServer(jtx::Env& env, bool ssl = true)
43  {
47  env.app().getIOService(),
48  list,
49  env.timeKeeper().now() + std::chrono::seconds{3600},
50  // No future VLs
51  {},
52  ssl);
53  }
54 
55 public:
56  // Test the shard downloading module by queueing
57  // a download and verifying the contents of the
58  // state database.
59  void
61  {
62  testcase("testSingleDownloadAndStateDB");
63 
64  beast::temp_dir tempDir;
65 
66  auto c = jtx::envconfig();
67  auto& section = c->section(ConfigSection::shardDatabase());
68  section.set("path", tempDir.path());
69  section.set("max_historical_shards", "20");
70  c->setupControl(true, true, true);
71 
72  jtx::Env env(*this, std::move(c));
73  auto handler = env.app().getShardArchiveHandler();
74  BEAST_EXPECT(handler);
75  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
76 
77  std::string const rawUrl = "https://foo:443/1.tar.lz4";
78  parsedURL url;
79 
80  parseUrl(url, rawUrl);
81  handler->add(1, {url, rawUrl});
82 
83  {
84  std::lock_guard<std::mutex> lock(handler->m_);
85  std::uint64_t rowCount = 0;
86 
88  *handler->sqlDB_, [&](std::string const& url, int state) {
89  BEAST_EXPECT(state == 1);
90  BEAST_EXPECT(url == rawUrl);
91  ++rowCount;
92  });
93 
94  BEAST_EXPECT(rowCount == 1);
95  }
96 
97  handler->release();
98  }
99 
100  // Test the shard downloading module by queueing
101  // three downloads and verifying the contents of
102  // the state database.
103  void
105  {
106  testcase("testDownloadsAndStateDB");
107 
108  beast::temp_dir tempDir;
109 
110  auto c = jtx::envconfig();
111  auto& section = c->section(ConfigSection::shardDatabase());
112  section.set("path", tempDir.path());
113  section.set("max_historical_shards", "20");
114  c->setupControl(true, true, true);
115 
116  jtx::Env env(*this, std::move(c));
117  auto handler = env.app().getShardArchiveHandler();
118  BEAST_EXPECT(handler);
119  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
120 
121  Downloads const dl = {
122  {1, "https://foo:443/1.tar.lz4"},
123  {2, "https://foo:443/2.tar.lz4"},
124  {3, "https://foo:443/3.tar.lz4"}};
125 
126  for (auto const& entry : dl)
127  {
128  parsedURL url;
129  parseUrl(url, entry.second);
130  handler->add(entry.first, {url, entry.second});
131  }
132 
133  {
134  std::lock_guard<std::mutex> lock(handler->m_);
135  std::uint64_t pos = 0;
136 
138  *handler->sqlDB_, [&](std::string const& url, int state) {
139  BEAST_EXPECT(state == dl[pos].first);
140  BEAST_EXPECT(url == dl[pos].second);
141  ++pos;
142  });
143 
144  BEAST_EXPECT(pos == dl.size());
145  }
146 
147  handler->release();
148  }
149 
150  // Test the shard downloading module by initiating
151  // and completing ten downloads and verifying the
152  // contents of the filesystem and the handler's
153  // archives.
154  void
156  {
157  testcase("testDownloadsAndFileSystem");
158 
159  beast::temp_dir tempDir;
160 
161  auto c = jtx::envconfig();
162  {
163  auto& section{c->section(ConfigSection::shardDatabase())};
164  section.set("path", tempDir.path());
165  section.set("max_historical_shards", "20");
166  section.set("ledgers_per_shard", "256");
167  section.set("earliest_seq", "257");
168  }
169  {
170  auto& section{c->section(ConfigSection::nodeDatabase())};
171  section.set("ledgers_per_shard", "256");
172  section.set("earliest_seq", "257");
173  }
174  c->setupControl(true, true, true);
175 
176  jtx::Env env(*this, std::move(c));
177 
178  std::uint8_t const numberOfDownloads = 10;
179 
180  // Create some ledgers so that the ShardArchiveHandler
181  // can verify the last ledger hash for the shard
182  // downloads.
183  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
184  (numberOfDownloads + 1);
185  ++i)
186  {
187  env.close();
188  }
189 
190  auto handler = env.app().getShardArchiveHandler();
191  BEAST_EXPECT(handler);
192  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
193 
194  auto server = createServer(env);
195  auto host = server->local_endpoint().address().to_string();
196  auto port = std::to_string(server->local_endpoint().port());
197  server->stop();
198 
199  Downloads const dl = [count = numberOfDownloads, &host, &port] {
200  Downloads ret;
201 
202  for (int i = 1; i <= count; ++i)
203  {
204  ret.push_back(
205  {i,
206  (boost::format("https://%s:%d/%d.tar.lz4") % host % port %
207  i)
208  .str()});
209  }
210 
211  return ret;
212  }();
213 
214  for (auto const& entry : dl)
215  {
216  parsedURL url;
217  parseUrl(url, entry.second);
218  handler->add(entry.first, {url, entry.second});
219  }
220 
221  BEAST_EXPECT(handler->start());
222 
223  auto stateDir =
225 
226  std::unique_lock<std::mutex> lock(handler->m_);
227 
228  BEAST_EXPECT(
229  boost::filesystem::exists(stateDir) || handler->archives_.empty());
230 
231  using namespace std::chrono_literals;
232  auto waitMax = 60s;
233 
234  while (!handler->archives_.empty())
235  {
236  lock.unlock();
238 
239  if (waitMax -= 1s; waitMax <= 0s)
240  {
241  BEAST_EXPECT(false);
242  break;
243  }
244 
245  lock.lock();
246  }
247 
248  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
249  }
250 
251  // Test the shard downloading module by initiating
252  // and completing ten downloads and verifying the
253  // contents of the filesystem and the handler's
254  // archives. Then restart the application and ensure
255  // that the handler is created and started automatically.
256  void
258  {
259  testcase("testDownloadsAndRestart");
260 
261  beast::temp_dir tempDir;
262 
263  {
264  auto c = jtx::envconfig();
265  {
266  auto& section{c->section(ConfigSection::shardDatabase())};
267  section.set("path", tempDir.path());
268  section.set("max_historical_shards", "20");
269  section.set("ledgers_per_shard", "256");
270  section.set("earliest_seq", "257");
271  }
272  {
273  auto& section{c->section(ConfigSection::nodeDatabase())};
274  section.set("ledgers_per_shard", "256");
275  section.set("earliest_seq", "257");
276  }
277  c->setupControl(true, true, true);
278 
279  jtx::Env env(*this, std::move(c));
280 
281  std::uint8_t const numberOfDownloads = 10;
282 
283  // Create some ledgers so that the ShardArchiveHandler
284  // can verify the last ledger hash for the shard
285  // downloads.
286  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
287  (numberOfDownloads + 1);
288  ++i)
289  {
290  env.close();
291  }
292 
293  auto handler = env.app().getShardArchiveHandler();
294  BEAST_EXPECT(handler);
295  BEAST_EXPECT(
296  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
297 
298  auto server = createServer(env);
299  auto host = server->local_endpoint().address().to_string();
300  auto port = std::to_string(server->local_endpoint().port());
301  server->stop();
302 
303  Downloads const dl = [count = numberOfDownloads, &host, &port] {
304  Downloads ret;
305 
306  for (int i = 1; i <= count; ++i)
307  {
308  ret.push_back(
309  {i,
310  (boost::format("https://%s:%d/%d.tar.lz4") % host %
311  port % i)
312  .str()});
313  }
314 
315  return ret;
316  }();
317 
318  for (auto const& entry : dl)
319  {
320  parsedURL url;
321  parseUrl(url, entry.second);
322  handler->add(entry.first, {url, entry.second});
323  }
324 
326  env.app().config());
327 
328  boost::filesystem::copy_file(
329  stateDir / stateDBName,
330  boost::filesystem::path(tempDir.path()) / stateDBName);
331 
332  BEAST_EXPECT(handler->start());
333 
334  std::unique_lock<std::mutex> lock(handler->m_);
335 
336  BEAST_EXPECT(
337  boost::filesystem::exists(stateDir) ||
338  handler->archives_.empty());
339 
340  using namespace std::chrono_literals;
341  auto waitMax = 60s;
342 
343  while (!handler->archives_.empty())
344  {
345  lock.unlock();
347 
348  if (waitMax -= 1s; waitMax <= 0s)
349  {
350  BEAST_EXPECT(false);
351  break;
352  }
353 
354  lock.lock();
355  }
356 
357  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
358 
359  boost::filesystem::create_directory(stateDir);
360 
361  boost::filesystem::copy_file(
362  boost::filesystem::path(tempDir.path()) / stateDBName,
363  stateDir / stateDBName);
364  }
365 
366  auto c = jtx::envconfig();
367  {
368  auto& section{c->section(ConfigSection::shardDatabase())};
369  section.set("path", tempDir.path());
370  section.set("max_historical_shards", "20");
371  section.set("shard_verification_retry_interval", "1");
372  section.set("shard_verification_max_attempts", "10000");
373  section.set("ledgers_per_shard", "256");
374  section.set("earliest_seq", "257");
375  }
376  {
377  auto& section{c->section(ConfigSection::nodeDatabase())};
378  section.set("ledgers_per_shard", "256");
379  section.set("earliest_seq", "257");
380  }
381  c->setupControl(true, true, true);
382 
383  jtx::Env env(*this, std::move(c));
384  std::uint8_t const numberOfDownloads = 10;
385 
386  // Create some ledgers so that the ShardArchiveHandler
387  // can verify the last ledger hash for the shard
388  // downloads.
389  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
390  (numberOfDownloads + 1);
391  ++i)
392  {
393  env.close();
394  }
395 
396  auto handler = env.app().getShardArchiveHandler();
397  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) != nullptr);
398 
399  auto stateDir =
401 
402  std::unique_lock<std::mutex> lock(handler->m_);
403 
404  BEAST_EXPECT(
405  boost::filesystem::exists(stateDir) || handler->archives_.empty());
406 
407  using namespace std::chrono_literals;
408  auto waitMax = 60s;
409 
410  while (!handler->archives_.empty())
411  {
412  lock.unlock();
414 
415  if (waitMax -= 1s; waitMax <= 0s)
416  {
417  BEAST_EXPECT(false);
418  break;
419  }
420 
421  lock.lock();
422  }
423 
424  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
425  }
426 
427  // Ensure that downloads fail when the shard
428  // database cannot store any more shards
429  void
431  {
432  testcase("testShardCountFailure");
433  std::string capturedLogs;
434 
435  {
436  beast::temp_dir tempDir;
437 
438  auto c = jtx::envconfig();
439  {
440  auto& section{c->section(ConfigSection::shardDatabase())};
441  section.set("path", tempDir.path());
442  section.set("max_historical_shards", "1");
443  section.set("ledgers_per_shard", "256");
444  section.set("earliest_seq", "257");
445  }
446  {
447  auto& section{c->section(ConfigSection::nodeDatabase())};
448  section.set("ledgers_per_shard", "256");
449  section.set("earliest_seq", "257");
450  }
451  c->setupControl(true, true, true);
452 
453  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
454  jtx::Env env(*this, std::move(c), std::move(logs));
455 
456  std::uint8_t const numberOfDownloads = 10;
457 
458  // Create some ledgers so that the ShardArchiveHandler
459  // can verify the last ledger hash for the shard
460  // downloads.
461  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
462  (numberOfDownloads + 1);
463  ++i)
464  {
465  env.close();
466  }
467 
468  auto handler = env.app().getShardArchiveHandler();
469  BEAST_EXPECT(handler);
470  BEAST_EXPECT(
471  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
472 
473  auto server = createServer(env);
474  auto host = server->local_endpoint().address().to_string();
475  auto port = std::to_string(server->local_endpoint().port());
476  server->stop();
477 
478  Downloads const dl = [count = numberOfDownloads, &host, &port] {
479  Downloads ret;
480 
481  for (int i = 1; i <= count; ++i)
482  {
483  ret.push_back(
484  {i,
485  (boost::format("https://%s:%d/%d.tar.lz4") % host %
486  port % i)
487  .str()});
488  }
489 
490  return ret;
491  }();
492 
493  for (auto const& entry : dl)
494  {
495  parsedURL url;
496  parseUrl(url, entry.second);
497  handler->add(entry.first, {url, entry.second});
498  }
499 
500  BEAST_EXPECT(!handler->start());
502  env.app().config());
503 
504  handler->release();
505  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
506  }
507 
508  auto const expectedErrorMessage =
509  "shards 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 maximum number of historical "
510  "shards reached";
511  BEAST_EXPECT(
512  capturedLogs.find(expectedErrorMessage) != std::string::npos);
513 
514  {
515  beast::temp_dir tempDir;
516 
517  auto c = jtx::envconfig();
518  {
519  auto& section{c->section(ConfigSection::shardDatabase())};
520  section.set("path", tempDir.path());
521  section.set("max_historical_shards", "0");
522  section.set("ledgers_per_shard", "256");
523  section.set("earliest_seq", "257");
524  }
525  {
526  auto& section{c->section(ConfigSection::nodeDatabase())};
527  section.set("ledgers_per_shard", "256");
528  section.set("earliest_seq", "257");
529  }
530  c->setupControl(true, true, true);
531 
532  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
533  jtx::Env env(*this, std::move(c), std::move(logs));
534 
535  std::uint8_t const numberOfDownloads = 1;
536 
537  // Create some ledgers so that the ShardArchiveHandler
538  // can verify the last ledger hash for the shard
539  // downloads.
540  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
541  ((numberOfDownloads * 3) + 1);
542  ++i)
543  {
544  env.close();
545  }
546 
547  auto handler = env.app().getShardArchiveHandler();
548  BEAST_EXPECT(handler);
549  BEAST_EXPECT(
550  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
551 
552  auto server = createServer(env);
553  auto host = server->local_endpoint().address().to_string();
554  auto port = std::to_string(server->local_endpoint().port());
555  server->stop();
556 
557  Downloads const dl = [count = numberOfDownloads, &host, &port] {
558  Downloads ret;
559 
560  for (int i = 1; i <= count; ++i)
561  {
562  ret.push_back(
563  {i,
564  (boost::format("https://%s:%d/%d.tar.lz4") % host %
565  port % i)
566  .str()});
567  }
568 
569  return ret;
570  }();
571 
572  for (auto const& entry : dl)
573  {
574  parsedURL url;
575  parseUrl(url, entry.second);
576  handler->add(entry.first, {url, entry.second});
577  }
578 
579  BEAST_EXPECT(!handler->start());
581  env.app().config());
582 
583  handler->release();
584  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
585  }
586 
587  auto const expectedErrorMessage2 =
588  "shard 1 maximum number of historical shards reached";
589  BEAST_EXPECT(
590  capturedLogs.find(expectedErrorMessage2) != std::string::npos);
591  }
592 
593  // Ensure that downloads fail when the shard
594  // database has already stored one of the
595  // queued shards
596  void
598  {
599  testcase("testRedundantShardFailure");
600  std::string capturedLogs;
601 
602  {
603  beast::temp_dir tempDir;
604 
605  auto c = jtx::envconfig();
606  {
607  auto& section{c->section(ConfigSection::shardDatabase())};
608  section.set("path", tempDir.path());
609  section.set("max_historical_shards", "1");
610  section.set("ledgers_per_shard", "256");
611  section.set("earliest_seq", "257");
612  }
613  {
614  auto& section{c->section(ConfigSection::nodeDatabase())};
615  section.set("ledgers_per_shard", "256");
616  section.set("earliest_seq", "257");
617  }
618  c->setupControl(true, true, true);
619 
620  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
621  jtx::Env env(
622  *this,
623  std::move(c),
624  std::move(logs),
626 
627  std::uint8_t const numberOfDownloads = 10;
628 
629  // Create some ledgers so that the ShardArchiveHandler
630  // can verify the last ledger hash for the shard
631  // downloads.
632  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
633  (numberOfDownloads + 1);
634  ++i)
635  {
636  env.close();
637  }
638 
639  BEAST_EXPECT(env.app().getShardStore()->prepareShards({1}));
640 
641  auto handler = env.app().getShardArchiveHandler();
642  BEAST_EXPECT(handler);
643  BEAST_EXPECT(
644  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
645 
646  auto server = createServer(env);
647  auto host = server->local_endpoint().address().to_string();
648  auto port = std::to_string(server->local_endpoint().port());
649  server->stop();
650 
651  Downloads const dl = [count = numberOfDownloads, &host, &port] {
652  Downloads ret;
653 
654  for (int i = 1; i <= count; ++i)
655  {
656  ret.push_back(
657  {i,
658  (boost::format("https://%s:%d/%d.tar.lz4") % host %
659  port % i)
660  .str()});
661  }
662 
663  return ret;
664  }();
665 
666  for (auto const& entry : dl)
667  {
668  parsedURL url;
669  parseUrl(url, entry.second);
670  handler->add(entry.first, {url, entry.second});
671  }
672 
673  BEAST_EXPECT(!handler->start());
675  env.app().config());
676 
677  handler->release();
678  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
679  }
680 
681  auto const expectedErrorMessage =
682  "shard 1 is already queued for import";
683  BEAST_EXPECT(
684  capturedLogs.find(expectedErrorMessage) != std::string::npos);
685  }
686 
687  void
688  run() override
689  {
696  }
697 };
698 
699 BEAST_DEFINE_TESTSUITE_PRIO(ShardArchiveHandler, app, ripple, 3);
700 
701 } // namespace test
702 } // namespace ripple
ripple::RPC::ShardArchiveHandler::getDownloadDirectory
static boost::filesystem::path getDownloadDirectory(Config const &config)
Definition: ShardArchiveHandler.cpp:38
std::this_thread::sleep_for
T sleep_for(T... args)
std::string
STL class.
std::shared_ptr
STL class.
ripple::parsedURL
Definition: StringUtilities.h:100
std::vector
STL class.
std::string::find
T find(T... args)
ripple::ConfigSection::shardDatabase
static std::string shardDatabase()
Definition: ConfigSections.h:38
ripple::test::ShardArchiveHandler_test::testShardCountFailure
void testShardCountFailure()
Definition: ShardArchiveHandler_test.cpp:430
std::chrono::seconds
std::lock_guard
STL class.
ripple::test::jtx::Env::timeKeeper
ManualTimeKeeper & timeKeeper()
Definition: Env.h:253
ripple::Application::getShardStore
virtual NodeStore::DatabaseShard * getShardStore()=0
ripple::test::jtx::Env::app
Application & app()
Definition: Env.h:241
ripple::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:49
ripple::test::ShardArchiveHandler_test::testDownloadsAndRestart
void testDownloadsAndRestart()
Definition: ShardArchiveHandler_test.cpp:257
ripple::test::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, ripple, 2)
ripple::test::ShardArchiveHandler_test::createServer
std::shared_ptr< TrustedPublisherServer > createServer(jtx::Env &env, bool ssl=true)
Definition: ShardArchiveHandler_test.cpp:42
std::vector::push_back
T push_back(T... args)
ripple::test::ShardArchiveHandler_test::testDownloadsAndFileSystem
void testDownloadsAndFileSystem()
Definition: ShardArchiveHandler_test.cpp:155
ripple::Application::config
virtual Config & config()=0
std::unique_lock
STL class.
std::to_string
T to_string(T... args)
ripple::test::jtx::Env::close
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
ripple::parseUrl
bool parseUrl(parsedURL &pUrl, std::string const &strUrl)
Definition: StringUtilities.cpp:47
std::uint64_t
ripple::test::TrustedPublisherServer::randomValidator
static Validator randomValidator()
Definition: TrustedPublisherServer.h:148
ripple::NodeStore::DatabaseShard::prepareShards
virtual bool prepareShards(std::vector< std::uint32_t > const &shardIndexes)=0
Prepare one or more shard indexes to be imported into the database.
beast::temp_dir::path
std::string path() const
Get the native path for the temporary directory.
Definition: temp_dir.h:66
ripple::Application::getIOService
virtual boost::asio::io_service & getIOService()=0
ripple::RPC::RecoveryHandler
Definition: ShardArchiveHandler.h:167
ripple::stateDBName
static constexpr auto stateDBName
Definition: DBInit.h:222
ripple::test::CaptureLogs
Log manager for CaptureSinks.
Definition: CaptureLogs.h:31
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test::ShardArchiveHandler_test::testRedundantShardFailure
void testRedundantShardFailure()
Definition: ShardArchiveHandler_test.cpp:597
ripple::readArchiveDB
void readArchiveDB(DatabaseCon &db, std::function< void(std::string const &, int)> const &func)
readArchiveDB Read entries from shard archive database and calls fiven callback for each entry.
Definition: RelationalDBInterface_shards.cpp:458
ripple::test::ShardArchiveHandler_test::testDownloadsAndStateDB
void testDownloadsAndStateDB()
Definition: ShardArchiveHandler_test.cpp:104
ripple::test::make_TrustedPublisherServer
std::shared_ptr< TrustedPublisherServer > make_TrustedPublisherServer(boost::asio::io_context &ioc, std::vector< TrustedPublisherServer::Validator > const &validators, NetClock::time_point validUntil, std::vector< std::pair< NetClock::time_point, NetClock::time_point >> const &futures, bool useSSL=false, int version=1, bool immediateStart=true, int sequence=1)
Definition: TrustedPublisherServer.h:714
beast::severities::kDebug
@ kDebug
Definition: Journal.h:35
ripple::test::ShardArchiveHandler_test::run
void run() override
Definition: ShardArchiveHandler_test.cpp:688
ripple::test::ShardArchiveHandler_test
Definition: ShardArchiveHandler_test.cpp:37
ripple::test::ManualTimeKeeper::now
time_point now() const override
Returns the estimate of wall time, in network time.
Definition: ManualTimeKeeper.cpp:37
ripple::test::ShardArchiveHandler_test::testSingleDownloadAndStateDB
void testSingleDownloadAndStateDB()
Definition: ShardArchiveHandler_test.cpp:60
std::unique_ptr
STL class.
ripple::getShardStore
static NodeStore::Database & getShardStore(Application &app)
Definition: ShardFamily.cpp:29
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
ripple::ConfigSection::nodeDatabase
static std::string nodeDatabase()
Definition: ConfigSections.h:33
beast::temp_dir
RAII temporary directory.
Definition: temp_dir.h:33
ripple::Application::getShardArchiveHandler
virtual RPC::ShardArchiveHandler * getShardArchiveHandler(bool tryRecovery=false)=0