Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkMappingOffline hangs until timeout #166

Open
christab81 opened this issue Dec 22, 2017 · 12 comments
Open

MarkMappingOffline hangs until timeout #166

christab81 opened this issue Dec 22, 2017 · 12 comments

Comments

@christab81
Copy link

In version 1.3.3 MarkMappingOffline just hangs until timeout exception occurs. When downgrading to 1.3.2 it works as expected.

Here is a stacktrace dump:
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperation.Do()
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.BaseShardMapper.Update[TMapping,TUpdate,TStatus](TMapping currentMapping, TUpdate update, Func4 constructMapping, Func2 statusAsInt, Func2 intAsStatus, Guid lockOwnerId) at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMapper1.Update(PointMapping1 currentMapping, PointMappingUpdate update, Guid lockOwnerId) at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.BaseShardMapper.SetStatus[TMapping,TUpdate,TStatus](TMapping mapping, TStatus status, Func2 getStatus, Func2 createUpdate, Func4 runUpdate, Guid lockOwnerId)
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMapper1.MarkMappingOffline(PointMapping1 mapping, Guid lockOwnerId)
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMap1.MarkMappingOffline(PointMapping1 mapping)

@ms92ita
Copy link

ms92ita commented Feb 26, 2018

I've encountered the same issue and I have resolved with the downgrade of version. But in my case I needed version 1.3.0 to resolve the timeout.
With the version 2.0.0 on preview, I've encountered a Null Reference Exception in MarkMappingOffline with this stacktrace:

in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationFactory.CreateUpdateMappingOperation(StoreOperationCode operationCode, ShardMapManager shardMapManager, Guid operationId, StoreOperationState undoStartState, XElement root, Guid originalShardVersionRemoves, Guid originalShardVersionAdds) in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationFactory.FromLogEntry(ShardMapManager shardMapManager, IStoreLogEntry so) in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperation.Do() in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.BaseShardMapper.Update[TMapping,TUpdate,TStatus](TMapping currentMapping, TUpdate update, Func'4 constructMapping, Func'2 statusAsInt, Func'2 intAsStatus, Guid lockOwnerId, MappingOptions options) in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMapper'1.Update(PointMapping'1 currentMapping, PointMappingUpdate update, Guid lockOwnerId, MappingOptions options) in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.BaseShardMapper.SetStatus[TMapping,TUpdate,TStatus](TMapping mapping, TStatus status, Func'2 getStatus, Func'2 createUpdate, Func'5 runUpdate, Guid lockOwnerId, MappingOptions options) in Microsoft.Azure.SqlDatabase..ElasticScale.ShardManagement.ListShardMapper'1.MarkMappingOffline(PointMapping'1 mapping, Guid lockOwnerId, MappingOptions options) in Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMap'1.MarkMappingOffline(PointMapping'1 mapping, MappingOptions options)

@marklar423
Copy link

marklar423 commented Feb 27, 2018

Downgrading to version 1.3.0 didn't work for me on Azure, but downgrading from 1.3.3 to 1.3.1 did work.

On version 1.3.3, I also get a timeout error when calling MarkMappingOffline

@nicksolsen
Copy link

Version 1.3.1 worked for me.

@coldwell
Copy link

I also experienced timeouts on 1.3.3. Downgrading to 1.3.2 worked as expected.

@brainded
Copy link

Has this been resolved in later builds? I am still on 1.3.2.

@jaredmoo
Copy link
Contributor

Sorry, no investigation or fix yet.

@brainded
Copy link

According to AppInsights the particular culprit is the following stored proc causing 100% of my timeouts: __ShardManagement.spKillSessionsForShardMappingLocal

@jaredmoo
Copy link
Contributor

That makes sense. Killing sessions can be slow if you have large transactions that are slow to roll back.

@brainded
Copy link

Is there something I could do to preemptively guard against that? Something I could potentially call to tell me that its not likely to work?

@jaredmoo
Copy link
Contributor

I believe so, SQL has DMV's that you can query to get information about active sessions/transactions/etc.

@devscalemat
Copy link

Is there any update/advice for this issue?
It tried to upgrade/downgrade client version. I have almost full elastic pool right now (97 dbs) and it would be nice to remove not needed ones since some tenants are no longer using the app.
I'm getting timeouts every time i try to set mapping to offline

@scottpantall
Copy link

I came across this issue using v2.3.0. I was able to use this method by including the MappingOptions parameter. mapping = ShardMap.MarkMappingOffline(mapping, MappingOptions.None);.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants