Skip to content

Commit 2edd017

Browse files
SurferJeffAtGooglebshaffer
authored andcommitted
Bump spanner stale read from 10 to 15 seconds. (GoogleCloudPlatform#478)
1 parent 2a530b5 commit 2edd017

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spanner/src/read_stale_data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function read_stale_data($instanceId, $databaseId)
4848
'Albums',
4949
$keySet,
5050
['SingerId', 'AlbumId', 'AlbumTitle'],
51-
['exactStaleness' => new Duration(10)]
51+
['exactStaleness' => new Duration(15)]
5252
);
5353

5454
foreach ($results->rows() as $row) {

spanner/test/spannerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ public function testReadOnlyTransaction()
223223
*/
224224
public function testReadStaleData()
225225
{
226-
// read-stale-data reads data that is exactly 10 seconds old. So, make sure 10 seconds
226+
// read-stale-data reads data that is exactly 15 seconds old. So, make sure 15 seconds
227227
// have elapsed since testUpdateData().
228228
$elapsed = time() - self::$lastUpdateDataTimestamp;
229-
if ($elapsed < 11) {
230-
sleep(11 - $elapsed);
229+
if ($elapsed < 16) {
230+
sleep(16 - $elapsed);
231231
}
232232
$output = $this->runCommand('read-stale-data');
233233
$this->assertContains('SingerId: 1, AlbumId: 1, AlbumTitle: Go, Go, Go', $output);

0 commit comments

Comments
 (0)